This PR was merged into the 2.8 branch.
Discussion
----------
Remove duplication of the handling of regex filters in the Finder
The logic to handle the multiple regexs in MultiplePcreFilterIterator children is the same each time (and will always be the same given it is related to the meaning of properties in MultiplePcreFilterIterator itself).
This extracts this logic in MultiplePcreFilterIterator itself rather than duplicating it in all child classes.
Commits
-------
e66bf64 Remove duplication of the handling of regex filters in the Finder
This PR was merged into the 2.8 branch.
Discussion
----------
[VarDumper] Add EnumStub for dumping virtual collections with casters
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Currently, casters may use arrays to represent a collection of virtual values. They are curently dumped the same as regular arrays, and this leads to noisy output (like the `array:%n` prefix, or the quotes around "keys").
This PR adds a new EnumStub for these situations.
Here is an example when using PdoCaster:
Before :
![before](https://cloud.githubusercontent.com/assets/243674/9976105/366a37dc-5ed8-11e5-9ee8-00a4a6b68fa9.png)
After:
![after](https://cloud.githubusercontent.com/assets/243674/9976106/3a9b78a2-5ed8-11e5-8209-1d629d3b1736.png)
Commits
-------
aa50596 [VarDumper] Add EnumStub for dumping virtual collections with casters
This PR was merged into the 2.7 branch.
Discussion
----------
[Config] Fix enum default value in Yaml dumper
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
The default value is not correctly included when dumping an EnumNode in Yaml. This is now fixed
Commits
-------
d135d82 [Config] Fix enum default value in Yaml dumper
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes#15843).
Discussion
----------
Finnish translation fix
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #15790
| License | MIT
| Doc PR | -
Fix for finnish translation typo
https://github.com/symfony/symfony/issues/15790
Commits
-------
84fbfb0 Finnish translation fix
This PR was merged into the 2.3 branch.
Discussion
----------
[CssSelector] Optimize regexs matching simple selectors
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
These shortcut parsers are applied first when converting a CSS selector to XPath, to be faster for simple selectors (tag matching, class matching with an optional tag, id matching with an optional tag).
None of the regexes defined here could have more chances to match more element when backtracking identifiers. So the backtracking is only slowing down the regex engine when the regex does not match (i.e. for any more complex selector for instance, or even for simple selectors without namespace of without tag name). Making quantifiers possessive solves this issue.
I also turned some capturing groups (around the namespace and the namespace delimiter) into non-capturing groups as we don't care about them in the output (they are just here to be optional).
Commits
-------
d5abe0b [CssSelector] Optimize regexs matching simple selectors
This PR was merged into the 2.3 branch.
Discussion
----------
[Console] Add clock mock to fix transient test on HHVM
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This should fix the most frequent transient test on HHVM (ProgressBarTest::testAnsiColorsAndEmojis)
Commits
-------
549f43b [Console] Add clock mock to fix transient test on HHVM
This PR was merged into the 2.3 branch.
Discussion
----------
Fix the phpdoc in the CssSelector TranslatorInterface
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The phpdoc of the interface does not match the behavior of the implementation. And the return type documented by the interface is impossible to return because the interface asks to apply a string prefix, and the only way is to cast the ``XPathExpr`` used internally to a string (which is what the implementation does).
This interface is an internal interface anyway.
Commits
-------
93ffa61 Fix the phpdoc in the CssSelector TranslatorInterface
This is quite technical. As you can see in the provider, the method is called
sometimes when the User changes, and so the token becomes de-authenticated (e.g.
someone else changes the password between requests).
In practice, the user should be unauthenticated. Using the anonymous token did this,
but throwing an AccountStatusException seems like a better idea. It needs to be an
AccountStatusException because the ExceptionListener from the Firewall looks for exceptions
of this class and logs the user out when they are found (because this is their purpose).
This solution is a copy of what AbstractAuthenticationListener does. Scenario:
1) Login
2) Go back to the log in page
3) Put in a bad user/pass
You *should* still be logged in after a failed attempt. This commit gives that behavior.
This looks like a subjective change (one more method, but the method implementations are
simpler), but it wasn't. The problem was that the UserChecker checkPreAuth should happen
*after* we get the user, but *before* the credentials are checked, and that wasn't possible
before this change. Now it is.
Here is the flow:
A) You login using guard and are given a PostAuthGuardToken
B) Your user changes between requests - AbstractToken::setUser() and hasUserChanged() - which
results in the Token becoming "not authenticated"
C) Something calls out to the security system, which then passes the no-longer-authed
token back into the AuthenticationProviderManager
D) Because the PostauthGuardToken implements GuardTokenInterface, the provider responds
to it. But, seeing that this is a no-longer-authed PostAuthGuardToken, it returns
an AnonymousToken, which triggers logout
The reason is that the GuardAuthenticationProvider *must* respond to *all* tokens
created by the system - both "pre auth" and "post auth" tokens. The reason is that
if a "post auth" token becomes not authenticated (e.g. because the user changes between
requests), then it may be passed to the provider system. If no providers respond (which
was the case before this commit), then AuthenticationProviderManager throws an exception.
The next commit will properly handle these "post auth" + "no-longer-authenticated" tokens,
which should cause a log out.
This PR was merged into the 2.7 branch.
Discussion
----------
[DomCrawler] Optimize the regex used to find namespace prefixes
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
I ran Blackfire on the [Mink BrowserKitDriver](https://github.com/minkphp/MinkBrowserKitDriver) testsuite (which is a realistic usage of the Mink API btw, as the driver testsuite is basically a functional test of a fixtures website, where failures are considered to be caused by the driver misbehaving).
I discovered that 17% of the time was spent in ``preg_match_all`` to look for prefixes in the XPath namespace prefixes (Mink does not use any namespace prefix in its Xpath queries).
This optimizes the regex to use a possessive quantifier. This avoids useless backtracking when matching (due to the way the regex is written, backtracking cannot allow finding more matches here). See https://blackfire.io/profiles/compare/21aaebf3-e38f-456a-8fc9-cf7d9e2a35eb/graph for the improvement.
The optimization is applied in the 2.7 branch, because this regex does not exist in 2.3: the registration of namespaces was added in 2.4
Commits
-------
02818e4 [DomCrawler] Optimize the regex used to find namespace prefixes
This PR was merged into the 2.8 branch.
Discussion
----------
[Translation][File dumper] allow new child classes to implement only formatCatalogue
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Fixed tickets | #15699
| Tests pass? | yes
| License | MIT
Commits
-------
5fd9f2f [Translation][File dumper] allow new child classes to implement only formatCatalogue.
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#15836).
Discussion
----------
[Form] fixed something: Remove whitespaces between <input> and <label>
| Q | A
| ------------- | ---
| Bug fix? | [no]
| New feature? | [no]
| BC breaks? | [?] What means BC?
| Deprecations? | [no]
| Tests pass? | [yes]
| Fixed tickets | []
| License | MIT
| Doc PR | []
Reason: With the whitespaces, there would be a "gap" between `<input>` and `<label>` which is clickable, but doesn't activate the `<input>`.
It's easy to *add* some margin with CSS, whereas it's impossible to *remove* whitespaces with CSS.
Commits
-------
1b97c17 Remove whitespaces between <input> and <label>
Reason: With the whitespaces, there would be a "gap" between <input> and <label> which is clickable, but doesn't activate the <input>.
It's easy to *add* some margin with CSS, whereas it's impossible to *remove* whitespaces with CSS.
This PR was merged into the 2.8 branch.
Discussion
----------
[Translation] Clean whitespaces and EOL in xliff-core-2.0.xsd
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
See https://github.com/symfony/symfony/pull/15833/files?w=1
Commits
-------
630f3b3 [Translation] Clean whitespaces and EOL in xliff-core-2.0.xsd