* 2.7:
Fix edge case with StreamedResponse where headers are sent twice
removed usage of Twig_Compiler::addIndentation
merge tags instead of completely replacing them
This PR was merged into the 2.7 branch.
Discussion
----------
Fix edge case with StreamedResponse where headers are sent twice
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes/no
| Fixed tickets |
| License | MIT
| Doc PR |
If you have PHPs output buffering enabled (`output_buffering=4096` in your php.ini per example), there is an edge case with the StreamedResponse object where the headers are sent twice. Even if it is harmless most of the time, it can be critical sometimes (per example, if an `Access-Control-Allow-Origin` header is duplicated the browser will block the request).
Explanation: because the streamed response may need the request in order to generate the content, the `StreamedResponseListener` class calls the send method of the `Response` when the event `kernel.response` is fired. To prevent the content from being duplicated, a state has been introduced in the `sendContent()` method and it works fine.
But there is an edge case is the headers of the response. If the content generated by the `sendContent()` method is smaller than the value defined for `output_buffering` in the `php.ini` then the buffer won't be flushed and the `headers_sent()` function will return false.
Therefore when `$response->send()` is called for the second time (in the `app.php` file), the headers will be sent a second time.
Commits
-------
a79991f Fix edge case with StreamedResponse where headers are sent twice
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] A decorated service should not keep the autowiring types
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20260#issuecomment-255364862
| License | MIT
| Doc PR | n/a
When decorating a service which is not abstract and has `autowiring_types`, the decorator should be the one used for autowiring methods of autowired services, so we should explicitly empty them on the decorated definition after merged them into the child. See https://github.com/symfony/symfony/pull/20260#issuecomment-255364862 for a use case where we are forced to manually empty the decorated service's `autowiring_types`.
Commits
-------
5951378 A decorated service should not keep the autowiring types
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] merge tags instead of completely replacing them
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | yes/no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20150, #20207
| License | MIT
| Doc PR |
In #20207, I missed the `array_merge()` call. Thus, previously set tags of the decorating service would have been discarded by the compiler pass.
Commits
-------
c333eb7 merge tags instead of completely replacing them
* 2.7:
[TwigBundle] fixed usage of getSource in tests
Trim constant values in XmlFileLoader
move test to the HttpKernel component
[TwigBridge] fixed Twig_Source required argument
This PR was merged into the 2.7 branch.
Discussion
----------
[FrameworkBundle][HttpKernel] move test to the HttpKernel component
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/19443#discussion_r83414612
| License | MIT
| Doc PR |
The moved test case does not test the `AddConsoleCommandPass` class, but ensures certain behavior in the `registerCommands()` method of the `Bundle` class from the HttpKernel component.
Commits
-------
c9ca322 move test to the HttpKernel component
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#20252).
Discussion
----------
Trim constant values in XmlFileLoader
| Q | A
| ------------- | ---
| Branch? | 2.7, 2.8, 3.1
| 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 an XML config file gets long, it's nice to put the constant name into the next line like this:
```xml
<parameter key="som_very_very_long_constant_name" type="constant">
Some\Namespace\That\Is\Sufficiently\Long\To\Require\A\LineBreak::someLongishConstantName
</parameter>
```
If that’s the case, `constant()` will try and find a constant including the spaces. While it is theoretically possible to have a constant in PHP that starts or ends with a space, it’s impossible for class constants and only doable using `define(" FOO ", …);`. So that’s probably an edge case we can ignore.
Commits
-------
f09e621 Trim constant values in XmlFileLoader
This PR was merged into the 2.8 branch.
Discussion
----------
[2.8][PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
5d5f704 [2.8][PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation
This PR was merged into the 2.7 branch.
Discussion
----------
[TwigBridge] Use non-deprecated Twig_Node::getTemplateLine()
| Q | A
| ------------- | ---
| Branch? |2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
bb791d0 [TwigBridge] Use non-deprecated Twig_Node::getTemplateLine()
This PR was merged into the 2.7 branch.
Discussion
----------
Fix readme quick tour link
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
Commits
-------
d367cfc Update README.md
* 2.7:
[DomCrawler] Optimize DomCrawler::relativize()
[HttpKernel] Fix source links with latests Twig versions
[DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
This PR was merged into the 2.7 branch.
Discussion
----------
[DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20229
| License | MIT
| Doc PR | -
@klausi could you please validate this patch? Is it an improvement over yours? (sorry I don't have the proper use case to test.)
Commits
-------
17757d8 [DomCrawler] Optimize DomCrawler::relativize()
5b26e33 [DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
* 2.7:
[TwigBridge] removed deprecations added in Twig 1.27
PHP CS Fixer: use php_unit_dedicate_assert
fixed Filesystem:makePathRelative and added 2 more testcases
no 304 response if method is not cacheable
move tags from decorated to decorating service
This PR was merged into the 2.7 branch.
Discussion
----------
PHP CS Fixer: use php_unit_dedicate_assert
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | see CIs
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
appendix for #19121
Commits
-------
b0df3a7 PHP CS Fixer: use php_unit_dedicate_assert
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes#20204).
Discussion
----------
3.0 Upgrade Guide: Describing how to pass data to a form through options resolver
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #18662
| License | MIT
| Doc PR |
Enhanced the upgrade guide by adding details regarding passing data to a form through the options resolver.
Commits
-------
b69bd3f 3.0 Upgrade Guide: Added details describing how to pass data to a form through the options resolver
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes#19478).
Discussion
----------
fixed Filesystem:makePathRelative and added 2 more testcases
| Q | A
| ------------- | ---
| Branch? |2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
The 2 new test cases where broken on the old code. The old testcases and the new one succeed with the given code.
Commits
-------
cd3206c fixed Filesystem:makePathRelative and added 2 more testcases
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpFoundation] no 304 response if method is not cacheable
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Since #19321 OPTIONS and TRACE are considered safe methods. But both methods should not lead to "304 Not modified" responses.
Commits
-------
3d6b450 no 304 response if method is not cacheable
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] move tags from decorated to decorating service
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20150
| License | MIT
| Doc PR |
Commits
-------
7def83c move tags from decorated to decorating service
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpCache] fix: do not cache OPTIONS request
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/20202
| License | MIT
| Doc PR | -
The HttpCache should not cache any OPTIONS request as they are by spec not cacheable (mentioned here https://github.com/symfony/symfony/issues/20202#issuecomment-253033144 by @xabbuh).
Commits
-------
c43de7f [HttpCache] fix: do not cache OPTIONS request