diff --git a/CHANGELOG-4.2.md b/CHANGELOG-4.2.md index f45e7e7273..7c7c018037 100644 --- a/CHANGELOG-4.2.md +++ b/CHANGELOG-4.2.md @@ -7,6 +7,35 @@ in 4.2 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.2.0...v4.2.1 +* 4.2.9 (2019-05-28) + + * bug #31584 [Workflow] Do not trigger extra guards (lyrixx) + * bug #31632 [Messenger] Use "real" memory usage to honor --memory-limit (chalasr) + * bug #31599 [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector (althaus) + * bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (Alumbrados) + * bug #31541 [DI] fix using bindings with locators of service subscribers (nicolas-grekas) + * bug #31568 [Process] Fix infinite waiting for stopped process (mshavliuk) + * bug #31551 [ProxyManager] isProxyCandidate() does not take into account interfaces (andrerom) + * bug #31335 [Doctrine] Respect parent class contract in ContainerAwareEventManager (Koc) + * bug #31421 [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name (przemyslaw-bogusz) + * bug #31510 Use the current working dir as default first arg in 'link' binary (lyrixx) + * bug #31524 [HttpFoundation] prevent deprecation when filesize matches error code (xabbuh) + * bug #31535 [Debug] Wrap call to require_once in a try/catch (lyrixx) + * bug #31477 [PropertyAccess] Add missing property to PropertyAccessor (vudaltsov) + * bug #31479 [Cache] fix saving unrelated keys in recursive callback calls (nicolas-grekas) + * bug #31438 [Serializer] Fix denormalization of object with variadic constructor typed argument (ajgarlag) + * bug #31445 [Messenger] Making cache rebuild correctly when message subscribers change (weaverryan) + * bug #31442 [Validator] Fix finding translator parent definition in compiler pass (deguif) + * bug #31475 [HttpFoundation] Allow set 'None' on samesite cookie flag (markitosgv) + * bug #31456 Remove deprecated usage of some Twig features (fabpot) + * bug #31207 [Routing] Fixed unexpected 404 NoConfigurationException (yceruto) + * bug #31261 [Console] Commands with an alias should not be recognized as ambiguous when using register (Simperfit) + * bug #31371 [DI] Removes number of elements information in debug mode (jschaedl) + * bug #31418 [FrameworkBundle] clarify the possible class/interface of the cache (xabbuh) + * bug #31411 [Intl] Fix root fallback locale (ro0NL) + * bug #31377 [Console] Fix auto-complete for ChoiceQuestion (multi-select answers) (battye) + * bug #31380 [WebProfilerBundle] Don't filter submitted IP values (javiereguiluz) + * 4.2.8 (2019-05-01) * bug #31338 Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" (nicolas-grekas) diff --git a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php index 115f486f02..e217820950 100644 --- a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php +++ b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php @@ -223,12 +223,17 @@ class BinaryFileResponse extends Response list($pathPrefix, $location) = $part; if (substr($path, 0, \strlen($pathPrefix)) === $pathPrefix) { $path = $location.substr($path, \strlen($pathPrefix)); + // Only set X-Accel-Redirect header if a valid URI can be produced + // as nginx does not serve arbitrary file paths. + $this->headers->set($type, $path); + $this->maxlen = 0; break; } } + } else { + $this->headers->set($type, $path); + $this->maxlen = 0; } - $this->headers->set($type, $path); - $this->maxlen = 0; } elseif ($request->headers->has('Range')) { // Process the range headers. if (!$request->headers->has('If-Range') || $this->hasValidIfRangeHeader($request->headers->get('If-Range'))) { diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php index 9f3beb08d1..effffe925b 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php @@ -339,6 +339,7 @@ class BinaryFileResponseTest extends ResponseTestCase ['/var/www/var/www/files/foo.txt', '/var/www/=/files/', '/files/var/www/files/foo.txt'], ['/home/Foo/bar.txt', '/var/www/=/files/,/home/Foo/=/baz/', '/baz/bar.txt'], ['/home/Foo/bar.txt', '"/var/www/"="/files/", "/home/Foo/"="/baz/"', '/baz/bar.txt'], + ['/tmp/bar.txt', '"/var/www/"="/files/", "/home/Foo/"="/baz/"', null], ]; } diff --git a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php index 03a7b7d9b8..261c9d3e05 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php @@ -43,7 +43,8 @@ class JsonResponseTest extends TestCase $this->assertSame('0', $response->getContent()); $response = new JsonResponse(0.1); - $this->assertSame('0.1', $response->getContent()); + $this->assertEquals('0.1', $response->getContent()); + $this->assertInternalType('string', $response->getContent()); $response = new JsonResponse(true); $this->assertSame('true', $response->getContent()); @@ -131,7 +132,8 @@ class JsonResponseTest extends TestCase $response = JsonResponse::create(0.1); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); - $this->assertSame('0.1', $response->getContent()); + $this->assertEquals('0.1', $response->getContent()); + $this->assertInternalType('string', $response->getContent()); $response = JsonResponse::create(true); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);