This PR was merged into the master branch.
Discussion
----------
[DomCrawler] Fixed an issue with namespace prefix matching being to greedy
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9121
| License | MIT
| Doc PR | -
The regexp matching prefixes is naive and matches most of strings followed by a colon: `/(?P<prefix>[a-z_][a-z_0-9\-\.]*):[^"\/]/i`.
It is also incomplete as it does not match all the supported characters (like the unicode ones). Implementing [the actual specification](http://www.w3.org/TR/2004/REC-xml-names11-20040204/#NT-PrefixedName) would mean creating a very complex expression, especially because we have to ignore strings contained in quotes etc.
This would match any XML tag name (names in quotes not ignored):
```php
$ncNameStartChar = 'a-z_\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}';
$ncNameChar = $ncNameStartChar.'.\\-0-9\\xB7\\x{0300}-\\x{036F}\\x{203F}-\\x{2040}';
$ncName = '['.$ncNameStartChar.']['.$ncNameChar.']*';
$regexp = sprintf('/(?P<prefix>%s):%s/iu', $ncName, $ncName);
```
Therefore, I decided NOT to throw an exception if found prefix is actually not a prefix. If a prefix used in xpath doesn't exist we'll still get a warning when running it (`DOMXPath::query(): Undefined namespace prefix`).
The current implementation is simple and will work in most situations. For edge cases, it's still possible to register prefixes manually.
What do you think?
Commits
-------
3292163 [DomCrawler] Fixed an issue with namespace prefix matching being to greedy.
The regexp matching prefixes is naive and matches most of strings followed by a colon. It is also incomplete as it does not match all the supported characters (like the unicode ones). It is simple though and sufficient in most situations.
This PR was merged into the master branch.
Discussion
----------
[Form] Implemented form debugger
Same as #9021 (kudos to @digitalkaoz!), with some added caramel.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
**Note:** Please keep in mind that this is a first version only. Not all features (especially UX/UI-wise) that I'd like to see are in there, but it's good enough for a first merge.
Commits
-------
89509d9 [Form] Improved form debugger
f56c577 [HttpKernel] Extracted value exporting logic of DataCollector into a separate ValueExporter class
56d78ed [Form] Decoupled methods of ResolvedFormType so that they can be overridden individually by decorators
a994a5d [Form] Merged subsriber/collector, also collect valid forms
1972a91 [Form] Added form debug collector
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#9125).
Discussion
----------
[BrowserKit] bugix: CookieJar returns cookies with domain "domain.com" f...
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Fixes this bug:
```php
$cookieJar = new CookieJar();
$cookieJar->set(new Cookie('foo', 'bar', null, '/', '.example.com'));
print_r($cookieJar->allValues('http://wwwexample.com'));
// expected result: array()
// actual result: array('foo' => 'bar')
```
Commits
-------
060b28e [BrowserKit] bugix: CookieJar returns cookies with domain "domain.com" for domain "foodomain.com"
This PR was merged into the 2.3 branch.
Discussion
----------
[DomCrawler] fixed HTML5 form attribute handling XPath query
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | 0a67c88e0e (commitcomment-4120595)
| License | MIT
| Doc PR | no
The XPath query used was not handling descendant form elements correctly, so I fixed it and added tests for it.
Commits
-------
bb59ac2 fixed HTML5 form attribute handling XPath query
This PR was merged into the 2.3 branch.
Discussion
----------
Removed old way of building icu data
Somehow these lines leaked from 2.2 while merging #9018. This needs to go to 2.3 and master.
Commits
-------
714a762 Removed old way of building icu data.
This PR was merged into the master branch.
Discussion
----------
[DomCrawler] Added auto-discovery and explicit registration of namespaces in filter() and filterByXPath()
| Q | A
| --- | ---
|Bug fix: | no
|Feature addition: |yes
|Backwards compatibility break: | yes, default namespace is no longer removed in the `addContent` method
|Symfony2 tests pass: | yes|
|Fixes the following tickets: | #4845
|Todo: | -
|License of the code:| MIT
|Documentation PR: | symfony/symfony-docs#2979
* added support for automatic discovery and explicit registration of document namespaces for `Crawler::filterXPath()` and `Crawler::filter()`
* improved content type guessing in `Crawler::addContent()`
* [BC BREAK] `Crawler::addXmlContent()` no longer removes the default document namespace
I mentioned in #4845 it would probably be possible to use [DOMNode::lookupNamespaceURI()](http://www.php.net/manual/en/domnode.lookupnamespaceuri.php) to find a namespace URI by given prefix. Unfortunately we cannot use it here since we'd have to call it on a node in the namespace we're looking for.
Current implementation makes the following query to find a namespace:
```php
$domxpath->query('(//namespace::*[name()="media"])[last()]')
```
Commits
-------
77e2fa5 [DomCrawler] Removed checks if CssSelector is present.
9110468 [DomCrawler] Enabled manual namespace registration.
be1e4e6 [DomCrawler] Enabled default namespace prefix overloading.
943d446 [DomCrawler] Updated the CHANGELOG with namespace auto-registration details.
c6fbb13 [DomCrawler] Added support for an automatic default namespace registration.
587e2dd [DomCrawler] Made that default namespace is no longer removed when loading documents with addXmlContent().
c905bba [DomCrawler] Added more tests for namespaced filtering.
6e717a3 [DomCrawler] Made sure only the default namespace is removed when loading an XML content.
e5b8abb [DomCrawler] Added auto-discovery of namespaces in Crawler::filter() and Crawler::filterByXPath().
* 2.3:
Run all tests in parallel.
Fixed an entity class name.
[HttpKernel] fix usage of deprecated FlattenException
Conflicts:
src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
* 2.2:
Run all tests in parallel.
Fixed an entity class name.
Conflicts:
.travis.yml
src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#9018).
Discussion
----------
Parallelized travis builds
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Yet another approach to running all tests in parallel (see #7708 and #8312).
This one uses [GNU Parallel](http://www.gnu.org/software/parallel/) which by default [will run one job per available CPU](http://www.gnu.org/software/parallel/man.html#jobs_n).
Comparison of random builds (recent build times on my travis account):
| PHP version| [master](https://travis-ci.org/jakzal/symfony/builds/11300678) | [parallel](https://travis-ci.org/jakzal/symfony/builds/11300689)
| ------------- | --- | ---
| 5.3.3| 6 min 11 sec | 3 min 45 sec
| 5.3| 7 min 26 sec | 4 min 10 sec
| 5.4| 6 min 31 sec | 3 min 31 sec
| 5.5| 6 min 37 sec | 3 min 45 sec
On my laptop it takes 1.5min to run a whole suite parallelised (compared to over 4min when run as usual).
Commits
-------
de8d1b5 Run all tests in parallel.
This PR was merged into the 2.2 branch.
Discussion
----------
Fixed an entity class name in a benchmark test
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Broken in #7940 (67ba131458). Since benchmark tests are not run on travis, it didn't complain.
Commits
-------
50ff35a Fixed an entity class name.
This PR was squashed before being merged into the master branch (closes#9095).
Discussion
----------
[ExpressionLanguage] Introduce a ParserCacheInterface with array/doctrine implementations
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
Commits
-------
c8e6799 [ExpressionLanguage] Introduce a ParserCacheInterface with array/doctrine implementations
Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows
value chaining (`https, http`, where `https` is always first when request is encrypted).
This PR was merged into the master branch.
Discussion
----------
[Security] limited the password length passed to encoders
Commits
-------
f7d0ec6 [Security] limited the password length passed to encoders
* 2.3:
[Locale] added support for the position argument to NumberFormatter::parse()
[Locale] added some more stubs for the number formatter
[Yaml] fixed typo
[Yaml] fixed a test on PHP < 5.4
[DomCrawler]Crawler guess charset from html
fixed PHP 5.3 compatibility
[Yaml] reverted previous merge partially (refs #8897)
[Security] remove unused logger
[Security] fix typo
[Yaml] Fixed filename in the ParseException message
* 2.2:
[Locale] added support for the position argument to NumberFormatter::parse()
[Locale] added some more stubs for the number formatter
[Yaml] fixed typo
[Yaml] fixed a test on PHP < 5.4
[DomCrawler]Crawler guess charset from html
fixed PHP 5.3 compatibility
[Yaml] reverted previous merge partially (refs #8897)
[Security] remove unused logger
[Security] fix typo
[Yaml] Fixed filename in the ParseException message
Conflicts:
src/Symfony/Component/Console/Input/InputDefinition.php
src/Symfony/Component/Locale/Stub/StubNumberFormatter.php
src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php