Commit Graph

29469 Commits

Author SHA1 Message Date
Fabien Potencier
924337fcb0 minor #22211 Fix @param in PHPDoc (GromNaN)
This PR was merged into the 3.2 branch.

Discussion
----------

Fix @param in PHPDoc

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

Errors reported by Sami API Doc generator on branch 3.2

```
ERROR: The "factory" @param tag variable name is wrong (should be "objectLoader") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: The "objectLoader" @param tag variable name is wrong (should be "factory") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: "7" @param tags are expected but only "6" found on "Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::__construct" in src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php:50
ERROR: "3" @param tags are expected but only "2" found on "Symfony\Component\Asset\PathPackage::__construct" in src/Symfony/Component/Asset/PathPackage.php:35
ERROR: "2" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\PhpArrayAdapter::create" in src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php:64
ERROR: "3" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\RedisAdapter::__construct" in src/Symfony/Component/Cache/Adapter/RedisAdapter.php:39
ERROR: The "format" @param tag variable name is wrong (should be "fileLinkFormat") on "Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat" in src/Symfony/Component/Debug/ExceptionHandler.php:90
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\Compiler::addPass" in src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:73
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\PassConfig::addPass" in src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php:97
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass" in src/Symfony/Component/DependencyInjection/ContainerBuilder.php:311
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface::getProxyFactoryCode" in src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php:41
ERROR: "0" @param tags are expected but only "1" found on "Symfony\Component\HttpFoundation\Request::isMethodSafe" in src/Symfony/Component/HttpFoundation/Request.php:1458
ERROR: "5" @param tags are expected but only "6" found on "Symfony\Component\Serializer\Normalizer\AbstractNormalizer::instantiateObject" in src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php:291
```

Errors that cannot be fixed are due to new arguments not included in the method signature for backward compatibility, but actually used by the code.

Commits
-------

6ed9d0e4c1 Fix @param in PHPDoc
2017-03-29 07:35:29 +02:00
Jérôme Tamarelle
6ed9d0e4c1 Fix @param in PHPDoc
Errors reported by Sami API Doc generator on branch 3.2

ERROR: The "factory" @param tag variable name is wrong (should be "objectLoader") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: The "objectLoader" @param tag variable name is wrong (should be "factory") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: "7" @param tags are expected but only "6" found on "Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::__construct" in src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php:50
ERROR: "3" @param tags are expected but only "2" found on "Symfony\Component\Asset\PathPackage::__construct" in src/Symfony/Component/Asset/PathPackage.php:35
ERROR: "2" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\PhpArrayAdapter::create" in src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php:64
ERROR: "3" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\RedisAdapter::__construct" in src/Symfony/Component/Cache/Adapter/RedisAdapter.php:39
ERROR: The "format" @param tag variable name is wrong (should be "fileLinkFormat") on "Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat" in src/Symfony/Component/Debug/ExceptionHandler.php:90
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\Compiler::addPass" in src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:73
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\PassConfig::addPass" in src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php:97
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass" in src/Symfony/Component/DependencyInjection/ContainerBuilder.php:311
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface::getProxyFactoryCode" in src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php:41
ERROR: "0" @param tags are expected but only "1" found on "Symfony\Component\HttpFoundation\Request::isMethodSafe" in src/Symfony/Component/HttpFoundation/Request.php:1458
ERROR: "5" @param tags are expected but only "6" found on "Symfony\Component\Serializer\Normalizer\AbstractNormalizer::instantiateObject" in src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php:291
2017-03-28 23:38:24 +02:00
Grégoire Pineau
8f090bca12 [Workflow] Added more PHPDoc 2017-03-28 10:44:09 +02:00
Fabien Potencier
da7893a7bf bug #22183 [Process] Fix bug which wiped or mangled env vars (pjcdawkins)
This PR was squashed before being merged into the 3.2 branch (closes #22183).

Discussion
----------

[Process] Fix bug which wiped or mangled env vars

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

Fixing (and testing) a one-character bug introduced in a recent commit 7d21c4a2cf

Commits
-------

9439237c81 [Process] Fix bug which wiped or mangled env vars
2017-03-27 11:07:03 -07:00
Patrick Dawkins
9439237c81 [Process] Fix bug which wiped or mangled env vars 2017-03-27 11:07:02 -07:00
Nicolas Grekas
56d476942c Merge branch '2.8' into 3.2
* 2.8:
  [HttpKernel] Fix test
  Remove port from default host in server:status command
  [Console] Escape exception messages
2017-03-27 16:49:31 +02:00
Nicolas Grekas
a0e654d981 Merge branch '2.7' into 2.8
* 2.7:
  [HttpKernel] Fix test
  Remove port from default host in server:status command
  [Console] Escape exception messages
2017-03-27 16:49:15 +02:00
Fabien Potencier
a0c2d5f760 minor #22178 [Console] Fix test (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Console] Fix test

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

To make appveyor green again.

Commits
-------

e9c3df6c94 [Console] Fix test
2017-03-27 07:45:47 -07:00
Fabien Potencier
dd3712601d minor #22177 [HttpKernel] Fix test (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Fix test

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

Should make 2.7 green again on Travis.

Commits
-------

ba8f46ad23 [HttpKernel] Fix test
2017-03-27 07:44:58 -07:00
Fabien Potencier
46cf21506c bug #22142 [Console] Escape exception messages in renderException (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Escape exception messages in renderException

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

Adding style on exception messages should be prevented, it leads to weird results.

> Allowing formatting in them would be a nightmare, given that Symfony itself applies some formatting when rendering the exception.

Commits
-------

cb1348231a [Console] Escape exception messages
2017-03-27 07:36:47 -07:00
Nicolas Grekas
e9c3df6c94 [Console] Fix test 2017-03-27 16:36:46 +02:00
Nicolas Grekas
ba8f46ad23 [HttpKernel] Fix test 2017-03-27 16:31:27 +02:00
Fabien Potencier
7c5e3c09e9 bug #22172 Fix port usage in server:status command (alcaeus)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix port usage in server:status command

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

This fixes a bug where running `console server:status -p 8001` won't work because the port is already contained in the default value for `address`.

Commits
-------

dbcfa5c659 Remove port from default host in server:status command
2017-03-27 07:09:20 -07:00
Andreas Braun
dbcfa5c659
Remove port from default host in server:status command 2017-03-27 08:24:12 +02:00
Fabien Potencier
dc66960f84 Merge branch '2.8' into 3.2
* 2.8:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
2017-03-26 08:47:15 -07:00
Fabien Potencier
d175340777 Merge branch '2.7' into 2.8
* 2.7:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
2017-03-26 08:40:40 -07:00
Fabien Potencier
359a0638a4 bug #22164 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Bridge\Doctrine] Fix change breaking doctrine-bundle test suite

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

Doctrine Bundle's test suite [is currently broken](https://travis-ci.org/doctrine/DoctrineBundle/jobs/215222182) with `2.8@dev` because the tests expect `addEventListener` to be called with an array as first arg, but #22001 optimized them away as string. Since internally strings are turned back into arrays, let's tweak that change and make Doctrine Bundle green again.

Commits
-------

0577c7b089 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
2017-03-26 08:40:16 -07:00
Nicolas Grekas
0577c7b089 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite 2017-03-26 17:09:07 +02:00
Fabien Potencier
3526d23414 minor #22163 [WebProfilerBundle] Include badge status in translation tabs (ro0NL)
This PR was merged into the 3.2 branch.

Discussion
----------

[WebProfilerBundle] Include badge status in translation tabs

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Minor consistency fix for the translation panel. Tab badges should indicate a certain status (at least the logs panel does as of 3.2). But for the missing translations (being the last tab) i think this is a good signal. And we could argue _defined_ fallback messages should really indicate a warning..

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24331093/8d9b1210-122d-11e7-9403-a5a86548b214.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24331104/bf2800b8-122d-11e7-92ea-57b2664e869f.png)

Funny sidenote; the log warning is about a missing translation 😅

Commits
-------

543ac435b8 [WebProfilerBundle] Include badge status in translation tabs
2017-03-26 08:02:38 -07:00
Roland Franssen
543ac435b8 [WebProfilerBundle] Include badge status in translation tabs 2017-03-26 14:00:52 +02:00
Fabien Potencier
b1bfbcc04b bug #22159 [FrameworkBundle] Cache pool clear command requires at least 1 pool (ro0NL)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #22159).

Discussion
----------

[FrameworkBundle] Cache pool clear command requires at least 1 pool

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes/no
| Fixed tickets | #22047
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

The commands help description already states this should be required.

```
The cache:pool:clear command clears the given cache pools or cache pool clearers.

    bin/console cache:pool:clear <cache pool or clearer 1> [...<cache pool or clearer N>]
```

So this could also be qualified a bugfix.

Commits
-------

a61797f850 [FrameworkBundle] Cache pool clear command requires at least 1 pool
2017-03-25 08:48:16 -07:00
Roland Franssen
a61797f850 [FrameworkBundle] Cache pool clear command requires at least 1 pool 2017-03-25 08:48:15 -07:00
Robin Chalas
cb1348231a [Console] Escape exception messages 2017-03-25 13:51:36 +01:00
Fabien Potencier
da0b520a50 bug #22133 [Filesystem] normalize paths before making them relative (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] normalize paths before making them relative

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

Commits
-------

d50ffa1de7 normalize paths before making them relative
2017-03-24 15:53:44 -07:00
Fabien Potencier
be3d2d2389 minor #22139 [HttpFoundation][DX] MockArraySessionStorage: phpdocs update (MacDada)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation][DX] MockArraySessionStorage: phpdocs update

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

Commits
-------

967f7a7add MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
2017-03-24 15:51:36 -07:00
Fabien Potencier
2606c48f69 bug #22138 [HttpFoundation][bugfix] $bags should always be initialized (MacDada)
This PR was squashed before being merged into the 2.7 branch (closes #22138).

Discussion
----------

[HttpFoundation][bugfix] $bags should always be initialized

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

Commits
-------

d984c73e66 [HttpFoundation][bugfix]  should always be initialized
2017-03-24 07:50:56 -07:00
Dawid Nowak
d984c73e66 [HttpFoundation][bugfix] should always be initialized 2017-03-24 07:50:55 -07:00
Dawid Nowak
967f7a7add MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work 2017-03-24 15:14:19 +01:00
Christian Flothmann
d50ffa1de7 normalize paths before making them relative 2017-03-24 08:21:37 +01:00
Fabien Potencier
fb56bcce98 Merge branch '2.8' into 3.2
* 2.8:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-23 09:09:32 -07:00
Fabien Potencier
f971f4f5f2 Merge branch '2.7' into 2.8
* 2.7:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-23 09:08:03 -07:00
Fabien Potencier
80af0838f5 removed test that does not test anything 2017-03-23 09:07:35 -07:00
Fabien Potencier
e31d3461ea fixed tests 2017-03-23 09:02:44 -07:00
Fabien Potencier
ac01aadbd6 bug #21810 #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile (Antanas Arvasevicius)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21810).

Discussion
----------

#21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile

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

then security.yml  providers was with upper case, on container compile error was thrown:
````
[04:39:32][Ant output]      [exec]      [exec] > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[04:39:32][Ant output]      [exec]      [exec]
[04:39:32][Ant output]      [exec]      [exec]
[04:39:32][Ant output]      [exec]      [exec]   [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
[04:39:32][Ant output]      [exec]      [exec]   The service "security.authentication.provider.simple_form.default" has a de
[04:39:32][Ant output]      [exec]      [exec]   pendency on a non-existent service "security.user.provider.concrete.carrier
[04:39:32][Ant output]      [exec]      [exec]   User".

`````

Problem has occurred with this commit line:
fbd9f88e31 (diff-2be909961a57bf75fbb600c1f5fc46e3R320)

Issue fixes with this PR.

Commits
-------

6d23c8c41c #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
2017-03-23 08:57:18 -07:00
Antanas Arvasevicius
6d23c8c41c #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile 2017-03-23 08:57:18 -07:00
Javier Eguiluz
f354a47450 bug #22123 [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page (e-moe)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page

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

Commits
-------

d980e70 [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
2017-03-23 12:38:07 +01:00
Nikolay Labinskiy
d980e706ad [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page 2017-03-23 11:48:03 +02:00
Fabien Potencier
a6b20d1e5c bug #19778 [Security] Fixed roles serialization on token from user object (eko)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Fixed roles serialization on token from user object

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

This PR fixes the serialization of tokens when using `Role` objects provided from the user. Indeed, there were actually a reference issue that can causes fatal errors like the following one:

```
FatalErrorException in RoleHierarchy.php line 43:
Error: Call to a member function getRole() on string
```

Here is a small code example to reproduce and its output:

``` php
$user = new Symfony\Component\Security\Core\User\User('name', 'password', [
    new Symfony\Component\Security\Core\Role\Role('name')
]);
$token = new Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken($user, 'password', 'providerKey', $user->getRoles());

$serialized = serialize($token);
$unserialized = unserialize($serialized);

var_dump($unserialized->getRoles());
```

Before:

```
array(1) { [0]=> bool(true) }
```

After:

```
array(1) { [0]=> object(Symfony\Component\Security\Core\Role\Role)#15 (1) {["role":"Symfony\Component\Security\Core\Role\Role":private]=> string(4) "name" } }
```

Thank you

Commits
-------

dfa7f5020e [Security] Fixed roles serialization on token from user object
2017-03-22 14:44:57 -07:00
Fabien Potencier
e3d90db747 bug #22036 Set Date header in Response constructor already (mpdude)
This PR was squashed before being merged into the 2.8 branch (closes #22036).

Discussion
----------

Set Date header in Response constructor already

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

Setting the `Date` header in the `Response` constructor has been removed in #14912 and changed to a more lazy approach in `getDate()`.

That way, methods like `getAge()`, `getTtl()` or `isFresh()` cause side effects as they eventually call `getDate()` and the Request "starts to age" once you call them.

I don't know if this would be a nice test, but current behaviour is

```php
        $response = new Response();
        $response->setSharedMaxAge(10);
        sleep(20);
        $this->assertTrue($response->isFresh());
        sleep(5);
        $this->assertTrue($response->isFresh());
        sleep(5);
        $this->assertFalse($response->isFresh());
```

A particular weird case is the `isCacheable()` method, because it calls `isFresh()` only under certain conditions, like particular status codes, no `ETag` present etc. This symptom is also described under "Cause of the problem" in #19390, however the problem is worked around there in other ways.

So, this PR suggests to effectively revert #14912.

Additionally, I'd like to suggest to move this special handling of the `Date` header into the `ResponseHeaderBag`. If the `ResponseHeaderBag` guards that we always have the `Date`, we would not need special logic in `sendHeaders()` and could also take care of https://github.com/symfony/symfony/pull/14912#issuecomment-110105215.

Commits
-------

3a7fa7ede2 Set Date header in Response constructor already
2017-03-22 14:18:49 -07:00
Matthias Pigulla
3a7fa7ede2 Set Date header in Response constructor already 2017-03-22 14:18:47 -07:00
Fabien Potencier
3aa7658399 bug #22022 [Validator] fix URL validator to detect non supported chars according to RFC 3986 (e-moe)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #22022).

Discussion
----------

[Validator] fix URL validator to detect non supported chars according to RFC 3986

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

Commits
-------

3599c476bf [Validator] fix URL validator to detect non supported chars according to RFC 3986
2017-03-22 13:42:35 -07:00
Nikolay Labinskiy
3599c476bf [Validator] fix URL validator to detect non supported chars according to RFC 3986 2017-03-22 13:42:34 -07:00
Fabien Potencier
f29664893d Merge branch '2.8' into 3.2
* 2.8:
  Fixed pathinfo calculation for requests starting with a question mark.
  [Security] simplify the SwitchUserListenerTest
2017-03-22 13:39:24 -07:00
Fabien Potencier
89bb89538b Merge branch '2.7' into 2.8
* 2.7:
  Fixed pathinfo calculation for requests starting with a question mark.
  [Security] simplify the SwitchUserListenerTest
2017-03-22 13:39:14 -07:00
Fabien Potencier
2240ecfa14 minor #22049 [Security] simplify the SwitchUserListenerTest (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] simplify the SwitchUserListenerTest

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

While working on #22048 I noticed that the `SwitchUserListenerTest` was more complicated than necessary by mocking a lot of stuff that didn't need to be mocked.

Commits
-------

923bbdbf9f [Security] simplify the SwitchUserListenerTest
2017-03-22 13:38:16 -07:00
Fabien Potencier
04fcac74b1 Merge branch '2.8' into 3.2
* 2.8:
  [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header
  [Validator] Add object handling of invalid constraints in Composite
  [WebProfilerBundle] Remove uneeded directive in the form collector styles
  Revert "bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)"
  [HttpFoundation] Fix Request::getHost() when having several hosts in X_FORWARDED_HOST
2017-03-22 13:31:03 -07:00
Fabien Potencier
8371dea4e2 bug #21849 [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header

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

We're missing handling of for/host/proto info embedded in the `Forwarded` header, as eg in:
`Forwarded:  for=1.1.1.1:443, host=foo.example.com:1234, proto=https, for=2.2.2.2, host=real.example.com:8080`

Commits
-------

04caacb757 [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header
2017-03-22 13:28:23 -07:00
Fabien Potencier
e8653b9964 bug #21968 Fixed pathinfo calculation for requests starting with a question mark. (syzygymsu)
This PR was squashed before being merged into the 2.7 branch (closes #21968).

Discussion
----------

Fixed pathinfo calculation for requests starting with a question mark.

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

With  improper `strpos` result check calculated pathinfo for requests starting with '?' equals to request itself.
Correct pathinfo for those requests should be '/'.

Commits
-------

43297b45de Fixed pathinfo calculation for requests starting with a question mark.
2017-03-22 13:27:23 -07:00
Anton A. Sumin
43297b45de Fixed pathinfo calculation for requests starting with a question mark. 2017-03-22 13:27:21 -07:00
Nicolas Grekas
04caacb757 [HttpFoundation] Fix missing handling of for/host/proto info from "Forwarded" header 2017-03-22 21:13:53 +01:00