Commit Graph

24968 Commits

Author SHA1 Message Date
Fabien Potencier
400e76706d updated CHANGELOG for 2.7.30 2017-07-03 17:21:42 +03:00
Fabien Potencier
71a69b40d2 minor #23322 [Serializer] Improve CircularReference detection message (ScullWM)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] Improve CircularReference detection message

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Hi,
I've get a CircularReferenceException error while serializing object with nested levels. Detect a CircularReference is great, but having more information about the object that generate this exception is better.

I simply suggest to add a `get_class` of the current object in the error message.

Before:
`A circular reference has been detected (configured limit: 1).`

After (edit)
`A circular reference has been detected when serializing the object of class "App\Domain\User" (configured limit: 1).`

Commits
-------

3a529e3391 Improve CircularReferenceException message
2017-07-03 16:30:36 +03:00
Thomas Perez
3a529e3391 Improve CircularReferenceException message 2017-07-03 15:09:40 +02:00
Fabien Potencier
77d06b5d39 bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[DoctrineBridge][Security][Validator] do not validate empty values

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23319
| License       | MIT
| Doc PR        |

Nearly all validators operating on scalar values (except for some special constraints) do ignore empty values. If you want to forbid them, you have to use the `NotBlank` constraint instead.

Commits
-------

fd7ad234bc do not validate empty values
2017-07-03 10:38:34 +03:00
Fabien Potencier
4e65c1f4e9 minor #23352 Translation fix (French word chaîne) (mcorteel)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #23352).

Discussion
----------

Translation fix (French word chaîne)

The French word "chaine" should be spelled "chaîne".

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| License       | MIT

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

b576f46c26 Misspelled word
2017-07-03 10:29:33 +03:00
mcorteel
b576f46c26 Misspelled word
The French word "chaine" should be spelled "chaîne".
2017-07-03 10:29:33 +03:00
Fabien Potencier
4c00279360 minor #23107 [Security] Fix annotation (enumag)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Fix annotation

| 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        |

Commits
-------

8a4d4eb563 [Security] Fix annotation
2017-07-03 10:26:42 +03:00
Fabien Potencier
64ea580eae bug #23274 Display a better error design when the toolbar cannot be displayed (yceruto)
This PR was squashed before being merged into the 2.7 branch (closes #23274).

Discussion
----------

Display a better error design when the toolbar cannot be displayed

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes (failure unrelated)
| Fixed tickets | https://github.com/symfony/symfony/pull/23266
| License       | MIT
| Doc PR        | n/a

Fixing the left position of the bar (tested in app without style) and escaping the literal newline (ES5) as some IDEs fails with previous syntax (and Github diff too). Btw, I have added the Symfony icon to make clear that this message comes from Symfony ;)

**Before:**
![current_toolbar_error](https://user-images.githubusercontent.com/2028198/27466735-cd5f0da8-57aa-11e7-8431-3025c41557e6.png)

**After:**
![after_toolbar_27](https://user-images.githubusercontent.com/2028198/27467928-75e45d4e-57b4-11e7-9e1f-e252d9085596.png)

Commits
-------

ed3e403b4b Display a better error design when the toolbar cannot be displayed
2017-07-03 10:01:20 +03:00
Yonel Ceruto
ed3e403b4b Display a better error design when the toolbar cannot be displayed 2017-07-03 10:01:07 +03:00
Fabien Potencier
03945c7d20 minor #23309 Identify tty tests in Component/Process (pmmaga)
This PR was merged into the 2.7 branch.

Discussion
----------

Identify tty tests in Component/Process

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

65d89ec224 Identify tty tests in Component/Process
2017-07-03 09:43:33 +03:00
Fabien Potencier
c1e8183f1b bug #23333 [PropertyAccess] Fix TypeError discard (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[PropertyAccess] Fix TypeError discard

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? |no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Given the following code:

```php
class Bar
{
    private $foos = [];

    public function getFoos(): array
    {
        return 'It doesn\'t respect the return type';
    }

    public function addFoo(Foo $foo)
    {
        // ...
    }

    public function removeFoo(Foo $dateTime)
    {
        // ...
    }
}

$object = new Bar();
$this->propertyAccessor->setValue($object, 'foos', array(new \DateTime()));
```

The `PropertyAccessor` will  crash (`[Symfony\Component\Debug\Exception\ContextErrorException]  Notice: Undefined offset: 0`) instead of displaying the (valid) PHP error.

This PR fixes the issue.

Commits
-------

e0c5040398 [PropertyAccess] Fix TypeError discard
2017-07-03 09:09:23 +03:00
Fabien Potencier
44c3f58265 minor #23327 [Validator] Throw exception on Comparison constraints null options (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Throw exception on Comparison constraints null options

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- see comment below -->
| Bug fix?      | no. There is no bug, but the constraint can be silently created in an invalid state.
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes (failure unrelated)
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

2de59a7381 [Validator] Throw exception on Comparison constraints null options
2017-07-03 08:46:34 +03:00
Fabien Potencier
cd8d4e68d4 bug #23345 [Console] fix description of INF default values (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] fix description of INF default values

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23267
| License       | MIT
| Doc PR        |

Commits
-------

d8ba440def [Console] fix description of INF default values
2017-07-03 07:26:10 +02:00
Christian Flothmann
fd7ad234bc do not validate empty values 2017-07-02 09:03:13 +02:00
Christian Flothmann
d8ba440def [Console] fix description of INF default values 2017-07-01 11:26:27 +02:00
Kévin Dunglas
e0c5040398
[PropertyAccess] Fix TypeError discard 2017-06-30 11:24:55 +02:00
Maxime Steinhausser
2de59a7381 [Validator] Throw exception on Comparison constraints null options 2017-06-30 08:56:32 +02:00
Pedro Magalhães
65d89ec224 Identify tty tests in Component/Process 2017-06-27 18:14:10 +02:00
Fabien Potencier
7acc34537b bug #23279 Don't call count on non countable object (pierredup)
This PR was merged into the 2.7 branch.

Discussion
----------

Don't call count on non countable object

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        |

From PHP 7.2, calling `count` on a non-countable object will emit a warning (https://wiki.php.net/rfc/counting_non_countables).
Based on the current test suit, this is the only place where I found this warning

Commits
-------

635bccdf8f Dont call count on non countable object
2017-06-24 09:42:08 -07:00
Fabien Potencier
73e9348237 bug #23283 [TwigBundle] add back exception check (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] add back exception check

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23268
| License       | MIT
| Doc PR        |

#23268 introduced a regression in that the full exception page was not shown anymore in case a template for the given format (if not `html`) could not be found.

Commits
-------

46c38df0fd [TwigBundle] add back exception check
2017-06-24 09:41:09 -07:00
Christian Flothmann
46c38df0fd [TwigBundle] add back exception check 2017-06-24 11:40:57 +02:00
Pierre du Plessis
635bccdf8f Dont call count on non countable object 2017-06-23 12:52:30 +02:00
Fabien Potencier
9fc9cc4123 bug #23268 Show exception is checked twice in ExceptionController of twig (gmponos)
This PR was submitted for the 3.4 branch but it was merged into the 2.7 branch instead (closes #23268).

Discussion
----------

Show exception is checked twice in ExceptionController of twig

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | N/A

I think that the $showException variable is checked twice. Check line 105 of the same file. Hope I did not miss anythings since the tests are passing.

Commits
-------

a433ceca41 Show exception is checked twice in ExceptionController of twig
2017-06-22 16:15:44 -07:00
George Mponos
a433ceca41 Show exception is checked twice in ExceptionController of twig 2017-06-22 16:15:38 -07:00
Fabien Potencier
f7de083cbd bug #23266 Display a better error message when the toolbar cannot be displayed (javiereguiluz)
This PR was merged into the 2.7 branch.

Discussion
----------

Display a better error message when the toolbar cannot be displayed

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23264
| License       | MIT
| Doc PR        | -

In action:

![profiler-error](https://user-images.githubusercontent.com/73419/27444352-5d0a1d60-5776-11e7-89c3-430cd6f38454.png)

Commits
-------

cc7275bccc Display a better error message when the toolbar cannot be displayed
2017-06-22 16:02:01 -07:00
Fabien Potencier
a66b967cae bug #23271 [FrameworkBundle] allow SSI fragments configuration in XML files (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] allow SSI fragments configuration in XML files

| 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        |

Commits
-------

99931a994b allow SSI fragments configuration in XML files
2017-06-22 16:00:41 -07:00
Christian Flothmann
99931a994b allow SSI fragments configuration in XML files 2017-06-22 22:44:44 +02:00
Javier Eguiluz
cc7275bccc Display a better error message when the toolbar cannot be displayed 2017-06-22 18:11:34 +02:00
Fabien Potencier
7cc97b6e0b bug #23254 [Form][TwigBridge] render hidden _method field in form_rest() (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form][TwigBridge] render hidden _method field in form_rest()

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14261
| License       | MIT
| Doc PR        |

Commits
-------

0ee3f57533 render hidden _method field in form_rest()
2017-06-21 12:28:21 -07:00
Christian Flothmann
0ee3f57533 render hidden _method field in form_rest() 2017-06-21 18:08:25 +02:00
Fabien Potencier
9a0d342226 bug #23250 [Translation] return fallback locales whenever possible (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Translation] return fallback locales whenever possible

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23248
| License       | MIT
| Doc PR        |

Commits
-------

3c21650d9e return fallback locales whenever possible
2017-06-21 07:18:43 -07:00
Christian Flothmann
3c21650d9e return fallback locales whenever possible 2017-06-21 13:03:18 +02:00
Fabien Potencier
6e75cee83e bug #22732 [Security] fix switch user _exit without having current token (dmaicher)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] fix switch user _exit without having current token

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22729
| License       | MIT
| Doc PR        | -

Attempting to `_exit` from a switched user caused an error when not having any token in the storage (for example happens when not logged in + disallowing anonymous users on that firewall):

`[1] Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Symfony\Component\Security\Http\Firewall\SwitchUserListener::getOriginalToken()
        must be an instance of Symfony\Component\Security\Core\Authentication\Token\TokenInterface, null given, called in
        symfony/symfony/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php on line 164`

Commits
-------

16da6861be [Security] fix switch user _exit without having current token
2017-06-19 11:57:05 -07:00
Fabien Potencier
71b61b04a1 minor #23222 [Routing] Fix XmlFileLoader exception message (voronkovich)
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] Fix XmlFileLoader exception message

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

When an `XmlFileLoader` encounters an unknown tag it throws an exception with message like `Unknown tag "foo" used in file "bar". Expected "default", "requirement" or "option".`. A proper message should be `Unknown tag "foo" used in file "bar". Expected "default", "requirement", "option"  or "condition".`

Commits
-------

f6a94cb56f [Routing] Fix XmlFileLoader exception message
2017-06-19 07:02:36 -07:00
Oleg Voronkovich
f6a94cb56f [Routing] Fix XmlFileLoader exception message 2017-06-18 21:08:05 +03:00
Fabien Potencier
ac9a527b81 bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

It is currently not possible to configure the `use_strict_mode` option for `NativeSessionStorage` in a proper manner.

The reason of this PR: https://github.com/symfony/symfony/pull/22352#issuecomment-302113533

It could be considered a new feature, but I wish it wouldn't, as I don't want to do any ugly hacking to get it working.

What else could be done?

* implement more options from `NativeSessionStorage` in the config?
* get rid of duplication somehow (maybe a static method in `NativeSessionStorage` that would return the option list and could be used in `FrameworkExtension`?)
* update `FrameworkExtensionTest`?
* update `ConfigurationTest`?
* update [the docs](https://symfony.com/doc/current/reference/configuration/framework.html#session)?

I'm willing to do those if decided.

Commits
-------

90e192e824 Sessions: configurable "use_strict_mode" option for NativeSessionStorage
2017-06-18 08:41:46 -07:00
Dawid Nowak
90e192e824 Sessions: configurable "use_strict_mode" option for NativeSessionStorage
https://github.com/symfony/symfony/pull/22352#issuecomment-302113533
2017-06-16 20:49:16 +02:00
Fabien Potencier
436d5e4e94 bug #23195 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 (NicolasPion)
This PR was squashed before being merged into the 2.7 branch (closes #23195).

Discussion
----------

[FrameworkBundle] [Command] Clean bundle directory, fixes #23177

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | no
| Fixed tickets | #23177
| License       | MIT

This PR fix #23177
when running an assets:install, it will remove directorys who do not have anymore a valid Bundle

Commits
-------

180f178f43 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177
2017-06-16 11:24:38 -07:00
Nicolas Pion
180f178f43 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 2017-06-16 11:24:36 -07:00
Fabien Potencier
c8884e7d9a bug #23052 [TwigBundle] Add Content-Type header for exception response (rchoquet)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Add Content-Type header for exception response

| 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        |

This PR comes after I was looking to customize the way exceptions are served for a JSON API (grabbed the info at http://symfony.com/doc/current/controller/error_pages.html#overriding-the-default-exceptioncontroller).

I noticed that even when changing the request format to 'json' so that the right json.twig template is served:
```php
// in my override of the ExceptionController
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
{
    $request->setRequestFormat('json');
    return parent::showAction($request, $exception, $logger);
}
```
the response Content-Type header was still 'text/html'.

By now, the response Content-Type should be corresponding to the given request format.

I also feel there's some room for improvement with the general "displaying error for a JSON API" chapter as it feels strange that there's no configuration option to just say "serve me anything as json", but that's another issue.

Commits
-------

9e2b408f25 add content-type header on exception response
2017-06-16 08:39:36 -07:00
Fabien Potencier
b8c94d03c2 bug #23199 Reset redirectCount when throwing exception (hvanoch)
This PR was merged into the 2.7 branch.

Discussion
----------

Reset redirectCount when throwing exception

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23197
| License       | MIT

When catching the exception throw when exceeding the redirect limit, all new request which results in a redirect fail. By resetting the redirectCount we can still use the same client instance.

Commits
-------

83fd578f96 Reset redirectCount when throwing exception
2017-06-15 07:57:21 -07:00
Fabien Potencier
511905d417 bug #23186 [TwigBundle] Move template.xml loading to a compiler pass (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Move template.xml loading to a compiler pass

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #23181 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

(failures unrelated)

Commits
-------

6ac0de8c2f [TwigBundle] Remove template.xml services when templating is disabled
2017-06-15 07:32:56 -07:00
Henne Van Och
83fd578f96 Reset redirectCount when throwing exception 2017-06-15 15:33:54 +02:00
Maxime Steinhausser
6ac0de8c2f [TwigBundle] Remove template.xml services when templating is disabled 2017-06-15 13:54:31 +02:00
rchoquet
9e2b408f25 add content-type header on exception response 2017-06-15 11:47:56 +02:00
Fabien Potencier
3c2b1ff929 bug #23130 Keep s-maxage when expiry and validation are used in combination (mpdude)
This PR was merged into the 2.7 branch.

Discussion
----------

Keep s-maxage when expiry and validation are used in combination

| 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        |

(Symfony) docs say that [expiration wins over validation](https://symfony.com/doc/current/http_cache/validation.html). So,

a) when both the master and embedded response are public with an s-maxage, the result should be public as well and use the lower s-maxage of both, *also* in the case that the embedded response carries validation headers. (The cache may use those for revalidating the embedded response once it has become stale, but that does not impact expiration-based caching of the combined response.)

b) when both the master and embedded response are public with an s-maxage, the result should be public as well and use the lower s-maxage of both, *also* in the case that the master response carries validation headers. However, those *must not* be passed on to the client: They do not apply to the combined response, but may only be used by the cache itself to revalidate the (raw) master response.

Commits
-------

09bcbc70e7 Embedding a response that combines expiration and validation, that should not defeat expiration on the combined response
2017-06-14 15:21:38 -07:00
Matthias Pigulla
09bcbc70e7 Embedding a response that combines expiration and validation, that should not defeat expiration on the combined response 2017-06-14 23:57:46 +02:00
Fabien Potencier
551e5ba515 bug #23129 Fix two edge cases in ResponseCacheStrategy (mpdude)
This PR was squashed before being merged into the 2.7 branch (closes #23129).

Discussion
----------

Fix two edge cases in ResponseCacheStrategy

| 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        |

While reviewing how `ResponseCacheStrategy` calculates the caching-related headers for responses that embed subrequests, I came across two cases that I think are currently implemented incorrectly.

a) When the main response is public and cacheable with an expiration time, but it embeds (via ESI) a controller that does not set any caching-related headers, this embedded response is more constrained. So, the resulting (combined) response must not be cacheable, especially it may not keep the s-maxage.

b) When the main response is public and cacheable with an expiration time, but it embeds (via ESI) a controller that explicitly creates a "private" response, the resulting (combined) response must be private as well.

Commits
-------

c6e8c07e4d Fix two edge cases in ResponseCacheStrategy
2017-06-14 14:29:16 -07:00
Matthias Pigulla
c6e8c07e4d Fix two edge cases in ResponseCacheStrategy 2017-06-14 14:29:14 -07:00
Fabien Potencier
814b43e510 feature #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL)
This PR was squashed before being merged into the 2.7 branch (closes #22636).

Discussion
----------

[Routing] Expose request in route conditions, if needed and possible

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16968, #22635
| License       | MIT
| Doc PR        | -

given

```
/**
 * @Route("/", name="homepage", condition="request.isXmlHttpRequest()")
 */
```

```
$ app/console route:match /
```

before

![image](https://cloud.githubusercontent.com/assets/1047696/25716808/b9ab518e-3100-11e7-8b59-21351b5c14ca.png)

after

![image](https://cloud.githubusercontent.com/assets/1047696/25716833/d08065fc-3100-11e7-9462-987b2c6eaa26.png)

Commits
-------

94371d052b [Routing] Expose request in route conditions, if needed and possible
2017-06-14 14:11:23 -07:00