diff options
Diffstat (limited to 'vendor/symfony/http-foundation')
| -rw-r--r-- | vendor/symfony/http-foundation/CHANGELOG.md | 4 | ||||
| -rw-r--r-- | vendor/symfony/http-foundation/Request.php | 2 | ||||
| -rw-r--r-- | vendor/symfony/http-foundation/Response.php | 6 | ||||
| -rw-r--r-- | vendor/symfony/http-foundation/Session/Session.php | 4 | ||||
| -rw-r--r-- | vendor/symfony/http-foundation/Tests/Session/SessionTest.php | 10 |
5 files changed, 19 insertions, 7 deletions
diff --git a/vendor/symfony/http-foundation/CHANGELOG.md b/vendor/symfony/http-foundation/CHANGELOG.md index 55eed3f7eb..88ebc33a5d 100644 --- a/vendor/symfony/http-foundation/CHANGELOG.md +++ b/vendor/symfony/http-foundation/CHANGELOG.md @@ -190,10 +190,10 @@ CHANGELOG * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This implementation is ESI compatible. * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire - behaviour of messages auto expiring after one page page load. Messages must + behavior of messages auto expiring after one page page load. Messages must be retrieved by `get()` or `all()`. * Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate - attributes storage behaviour from 2.0.x (default). + attributes storage behavior from 2.0.x (default). * Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for namespace session attributes. * Flash API can stores messages in an array so there may be multiple messages diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php index 7f44aab1d5..7cf2120a51 100644 --- a/vendor/symfony/http-foundation/Request.php +++ b/vendor/symfony/http-foundation/Request.php @@ -1330,7 +1330,7 @@ class Request * * @param string|null $default The default format * - * @return string The request format + * @return string|null The request format */ public function getRequestFormat($default = 'html') { diff --git a/vendor/symfony/http-foundation/Response.php b/vendor/symfony/http-foundation/Response.php index 26b3f209d5..c3ac19d4a9 100644 --- a/vendor/symfony/http-foundation/Response.php +++ b/vendor/symfony/http-foundation/Response.php @@ -306,9 +306,9 @@ class Response } // Check if we need to send extra expire info headers - if ('1.0' == $this->getProtocolVersion() && false !== strpos($this->headers->get('Cache-Control'), 'no-cache')) { - $this->headers->set('pragma', 'no-cache'); - $this->headers->set('expires', -1); + if ('1.0' == $this->getProtocolVersion() && false !== strpos($headers->get('Cache-Control'), 'no-cache')) { + $headers->set('pragma', 'no-cache'); + $headers->set('expires', -1); } $this->ensureIEOverSSLCompatibility($request); diff --git a/vendor/symfony/http-foundation/Session/Session.php b/vendor/symfony/http-foundation/Session/Session.php index 867ceba97f..62ce948b68 100644 --- a/vendor/symfony/http-foundation/Session/Session.php +++ b/vendor/symfony/http-foundation/Session/Session.php @@ -193,7 +193,9 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable */ public function save() { - $this->storage->save(); + if ($this->isStarted()) { + $this->storage->save(); + } } /** diff --git a/vendor/symfony/http-foundation/Tests/Session/SessionTest.php b/vendor/symfony/http-foundation/Tests/Session/SessionTest.php index afa00fc7c3..e75b3321b0 100644 --- a/vendor/symfony/http-foundation/Tests/Session/SessionTest.php +++ b/vendor/symfony/http-foundation/Tests/Session/SessionTest.php @@ -260,4 +260,14 @@ class SessionTest extends TestCase $flash->get('hello'); $this->assertTrue($this->session->isEmpty()); } + + public function testSaveIfNotStarted() + { + $storage = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface')->getMock(); + $session = new Session($storage); + + $storage->expects($this->once())->method('isStarted')->willReturn(false); + $storage->expects($this->never())->method('save'); + $session->save(); + } } |
