This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11601).
Discussion
----------
[Validator] Allow basic auth in url when using UrlValidator.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Now an url with basic auth like ```http://username:password@symfony.com``` can be valid.
Commits
-------
f1ea987 Allow basic auth in url. Improve regex. Add tests.
This PR was merged into the 2.3 branch.
Discussion
----------
[Console] fixed style creation when providing an unknown tag option
| 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
When formatting a string, the console ignore style it cannot parse. But if a string looks like an option (`<setting=value>`) for instance, instead of displaying the text as is, it currently throws an exception.
Commits
-------
8814920 [Console] fixed style creation when providing an unknown tag option
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11605).
Discussion
----------
[WebProfilerBundle] Fix typos and syntax in Profiler controller method comments
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
be03b75 fix typos and syntax in Profiler controller method comments
The previous fix in #11548 for handling XPath axes was not backward
compatible. In previous Symfony versions the Crawler handled nodes
by holding a "fake root node". This must be taken into account when
evaluating (relativizing) XPath expressions.
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#10914).
Discussion
----------
[HttpKernel] added an analyze of environment parameters for built-in server
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | #10208
| License | MIT
| Doc PR | -
With the built-in server, it is not possible to use the external parameters: environment variables are only in `$_ENV`.
Commits
-------
696b978 [HttpKernel] added an analyze of environment parameters for built-in server.
The PropertyMetadataContainerInterface defines that the method
getPropertyMetadata() has to return an empty collection if no
metadata have been configured for the given property. Though, its
implementation in the ClassMetadata class didn't check for
existence of such metadata. This behavior led to unexpected PHP
notices when validating a property or a property value of a property
without any configured constraints (only affects the new 2.5 API).
Additionally, the getMemberMetadatas() didn't check for existing
array keys as well which has also been fixed.
This PR was merged into the 2.3 branch.
Discussion
----------
[Process] Added process synchronization to the incremental output tests
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The tests currently fail from time to time if the executing machine is under
heavy load. This leads to false negatives on Travis CI.
A side effect of the change is that the tests are much faster now.
Commits
-------
6dd3946 [Process] Added process synchronization to the incremental output tests
This PR was merged into the 2.3 branch.
Discussion
----------
[Finder] Shell escape and windows support
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Add escaping of command passed to Shell::testCommand().
Fix todo add support for windows.
Commits
-------
c70a226 change command to which available under most unix systems
85e77b1 add way to test command under windows
4fa9288 fix shell command injection
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11576).
Discussion
----------
[Form] allowed CallbackTransformer to use callable
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
I want to use the callable(i.e. inner class methods) in CallbackTransformer, but its current constructor is defined argument type hinting for \Closure so i can't.
Commits
-------
e77022b [Form] allowed CallbackTransformer to use callable
The tests currently fail from time to time if the executing machine is under
heavy load. This leads to false negatives on Travis CI.
A side effect of the change is that the tests are much faster now.
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11499).
Discussion
----------
[BrowserKit] Fixed relative redirects for ambiguous paths
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This fixes a problem I discovered today during Mink testing: I have a route with a slug and id, separated by colon (`/{slug}:{id}`). When the `HTTP_HOST` is being normalized it only checks for array key existence, not emptyness. In this case it was `false` due to the `parse_url` call in `updateServerFromUri`, which cannot handle this case:
```
$> php -r "var_dump(parse_url('/redirect', PHP_URL_HOST));" NULL
$> php -r "var_dump(parse_url('/redirect:1234', PHP_URL_HOST));" bool(false)
```
So now the url becomes `http:///redirect:1234`, because of the missing host.
Commits
-------
5ecc449 Fixed relative redirects for ambiguous paths
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11516).
Discussion
----------
[BrowserKit] Fix browser kit redirect with ports
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | No ticket opened
| License | MIT
| Doc PR | None
Whilst using Mink to do automated tests, I encountered a problem where redirects with ports would not work as the port was removed in the `updateServerFromURI()` method. This PR fixes the problem.
During my testing I encountered `$client->followRedirects(false);` in the ClientTest class that was causing the redirectWithPort test to pass even though it should have been failing (Removing the line caused the test to correctly fail before the patch was written)
Commits
-------
39973de [BrowserKit] Fix browser kit redirect with ports
This PR was merged into the 2.3 branch.
Discussion
----------
[Bundle][FrameworkBundle] built-in server: exit when docroot does not exist
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6496
| License | MIT
| Doc PR |
When the server:run command is run with an invalid document root
directory (for example, when being in the app directory and not
changing the document root to ../web/), the command crashes on Windows
with a 267 exit code. On Linux, the server starts but just publishes
internal server errors.
Commits
-------
f143254 built-in server: exit when docroot does not exist
This PR was squashed before being merged into the 2.3 branch (closes#11554).
Discussion
----------
[TwigBridge] [Form] Fixed some extra empty spaces
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Extra empty spaces for choice_widget_collapsed, they were introduced by commit 8f9ed3ebb9 by @chrisguitarguy
Commits
-------
16bd88e [TwigBridge] [Form] Fixed some extra empty spaces
This PR was merged into the 2.3 branch.
Discussion
----------
[Form] fix whitespace in Twig form template
| Q | A
| ------------- | ---
| Bug fix? | kind of (after updating from 2.3.17 to 2.3.18, some of my tests were broken because of this)
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | they should, let's see what Travis has to say...
| Fixed tickets | --
| License | MIT
| Doc PR | --
This fixes some whitespace rendering.
after merging #11386:
```html
<input type="text" id="myfield" name="myfield" value="blah" />
```
before merging #11386 and with this PR again:
```html
<input type="text" id="myfield" name="myfield" value="blah" />
```
Commits
-------
8504d02 fixed whitespace in Twig form template
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11560).
Discussion
----------
Plural fix
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no*
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11517
| License | MIT
*BC note - this breaks code if people build on top of the incorrect returned value `drife`.
Fixes the `singular` for `drives`. I've added more test values to prove more edge cases and to show this changes doesn't break other `singular`-look ups.
In the test class i've added a few `known issues` for later reference/fixure.
Commits
-------
9b550d6 Plural fix
This PR was merged into the 2.3 branch.
Discussion
----------
[DependencyInjection] Fixed missing 'factory-class' attribute in XmlDumper output
| 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
Problem: XmlDumper doesn't write 'factory-class' XML attribute for definitions on which setFactoryClass() was called.
Impact: Container[Builder] to throws an exception when the relevant service is being requested/initiated after loading the dumped XML.
`Uncaught Exception Symfony\Component\DependencyInjection\Exception\RuntimeException: "Cannot create service "xxx" from factory method without a factory service or factory class." at /<path>/<to>//DependencyInjection/ContainerBuilder.php`
Solution: Made XmlDumper write the 'factory-class' attribute, and updated the relevant test fixture.
Another related problem, is that XMLFileLoader doesn't complain if the 'factory-class' attribute is missing for a 'service' elements that include 'factory-method' attribute, resulting in an ill-configured Definition object in the ContainerBuilder. I'll post an issue/ticket, and probably send another PR for that.
Commits
-------
18e3e6f [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
Symfony\Component\DependencyInjection\Dumper\XmlDumper didn't write 'factory-class' XML attribute for definitions on which setFactoryClass() was called.
This caused the Container[Builder] to throw an exception when the relevant service is being requested/initiated after loading the dumped XML:
`Uncaught Exception Symfony\Component\DependencyInjection\Exception\RuntimeException: "Cannot create service "xxx" from factory method without a factory service or factory class." at /<path>/<to>/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php`
Fixed the problem, and updated the relevant test fixture.
This PR was merged into the 2.3 branch.
Discussion
----------
[Component][DomCrawler] fix axes handling in Crawler::filterXPath()
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11503
| License | MIT
| Doc PR |
Due to some limitations in the ``relativize()`` method, it was not possible to use XPath axes other than ``descendant`` or ``descendant-or-self`` in the ``filterXPath()`` method of the ``Crawler`` class. This commit adds support for the ``ancestor``, ``ancestor-or-self``, ``attribute``, ``child``, ``following``, ``following-sibling``, ``parent``, ``preceding``, ``preceding-sibling`` and ``self`` axes.
The only axis missing after this is the ``namespace`` axis. Filtering for namespace nodes returns ``DOMNameSpaceNode`` instances which can't be passed to the ``add()`` method.
Commits
-------
8dc322b fix axes handling in Crawler::filterXPath()
Due to some limitations in the relativize() method, it was not
possible to use XPath axes other than descendant or descendant-or-self
in the filterXPath() method of the Crawler class. This commit adds
support for the ancestor, ancestor-or-self, attribute, child,
following, following-sibling, parent, preceding, preceding-sibling and
self axes.
This PR was merged into the 2.3 branch.
Discussion
----------
fix some docblocks
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
1775da5 fix some docblocks
When the server:run command is run with an invalid document root
directory (for example, when being in the app directory and not
changing the document root to ../web/), the command crashes on Windows
with a 267 exit code. On Linux, the server starts but just publishes
internal server errors.
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11422).
Discussion
----------
[DependencyInjection] Self-referenced 'service_container' service breaks garbage collection
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Needs merge to | 2.4
| Fixed tickets | —
| License | MIT
| Doc PR | —
#### Problem
1. `Container::__construct()` sets the `service_container` service ID to a self-reference of `$this`.
1. This breaks PHP garbage collection (as well as `clone`).
#### Background
* As explained in [Reference Counting Basics](http://php.net/manual/en/features.gc.refcounting-basics.php), PHP is not able to destruct and garbage collect variables that contain a reference to itself, because the `refcount` is always > 0.
#### Example Use-Case
A precompiled container that is cloned for multiple tests (because `::compile()` can be slow).
```php
$precompiled = new ContainerBuilder();
// ...
$precompiled->compile();
foreach ($precompiled->getServiceIds() as $id) {
if ($precompiled->initialized($id)) {
$precompiled->set($id, null);
}
}
$precompiled_clean = clone $precompiled;
$precompiled = NULL;
// ...
foreach ($tests as $test) {
$container = clone $precompiled_clean;
// Required without this PR:
$container->set('service_container', $container);
// ...
}
```
* **Actual result [master]:**
All references to the original `$precompiled` container are not destructed and cleaned up, because `$precompiled` still references itself, which can cause terribly hard to debug defects due to stale reference pointers in memory (especially with `ContainerAware` services, or things like e.g. PDO connections), as well as high memory consumption, etc.
* **Expected result [PR]:**
No references to `$precompiled` are left; everything is shut down, cleaned up, and garbage-collected upon `$precompiled = NULL;`
#### Proposed solution
1. Hard-code a special behavior for the service ID `service_container`.
1. Remove the self-reference.
1. For now (until next major release), ensure that all `Container` methods work identically to before — instead of throwing exceptions when e.g. trying to set `service_container` to something that isn't `$this`… (which is technically possible right now, but the operation doesn't remotely make sense)
#### API changes
Per (3) above, this PR is backwards-compatible. However, for the sake of full disclosure, users may experience the following super-micro changes compared to HEAD:
1. The following method no longer exists in a dumped Container, because it is no longer a registered service:
```php
protected function getServiceContainerService()
{
throw new RuntimeException('You have requested a synthetic service ("service_container"). The DIC does not know how to construct this service.');
}
```
But given the exception, you weren't able to call it anyway.
1. The order/position of `service_container` in the array returned by `Container::getServiceIds()` may be different.
But that array has no particular order to begin with.
(Only the component's own unit tests are expecting an identical result at times, which is why I added the hard-coded ID via `$id[]` last, instead of initializing it first with `$id` already.)
1. `$container->set('service_container', $not_the_container);` no longer works.
Commits
-------
440322e Fixed self-reference in 'service_container' service breaks garbage collection (and clone).
This PR was merged into the 2.3 branch.
Discussion
----------
[Process] Fix tests when pcntl is not available.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
It's solved the same way in the [AbstractProcessTest](3b837dc5c1/src/Symfony/Component/Process/Tests/AbstractProcessTest.php (L602-L603)).
Commits
-------
e40f24f [Process] Fix tests when pcntl is not available.
This PR was merged into the 2.3 branch.
Discussion
----------
Make builds green again
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR rolls back changes made to the fixture and generated files in e9022adaef (#11512).
Commits
-------
88b4e70 [DependencyInjection] Roll back changes made to generated files.
f89811d [Console] Roll back changes made to fixture files.
This PR was merged into the 2.3 branch.
Discussion
----------
[Serializer] properly handle null data when denormalizing
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10794
| License | MIT
| Doc PR |
Commits
-------
123fc62 properly handle null data when denormalizing