From 0cef5f3ec9b7c9ab47842c7b6f9f2b8cf77cdd8a Mon Sep 17 00:00:00 2001 From: mmokhi Date: Fri, 24 May 2019 19:14:44 +0200 Subject: [PATCH 01/13] Use AsserEquals for floating-point values Use AssertEquals for these two specific case will do a better job, since it'll convert both '0.1' and result of `getContent()` into PHP's internal representation of floating-point and compares them and it should be fine. Using `AssertSame` for this tests brings floating-point serialization into consideration which of course will be php.ini specific. In order not missing the type assertion point that `AssertSame` does, we also perform `assertInternalType('string'...` Sponsored-by: Platform.sh --- .../Component/HttpFoundation/Tests/JsonResponseTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php index 5425896dfa3b7..ef0346cbe6dae 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php @@ -52,7 +52,8 @@ public function testConstructorWithSimpleTypes() $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()); @@ -140,7 +141,8 @@ public function testStaticCreateWithSimpleTypes() $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); From cf1fa466d9f2bcb7242d1b8e4de4474938330f8f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 14:07:06 +0200 Subject: [PATCH 02/13] updated CHANGELOG for 4.2.9 --- CHANGELOG-4.2.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG-4.2.md b/CHANGELOG-4.2.md index f45e7e7273ab4..7c7c018037c6d 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) From c4462f6695f95ce5ad6255594d5f054b707acb24 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 14:07:12 +0200 Subject: [PATCH 03/13] updated VERSION for 4.2.9 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 541aced9f58c1..fd063881387d8 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.2.9-DEV'; + const VERSION = '4.2.9'; const VERSION_ID = 40209; const MAJOR_VERSION = 4; const MINOR_VERSION = 2; const RELEASE_VERSION = 9; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '07/2019'; const END_OF_LIFE = '01/2020'; From 2d72ec1a107f01abccc07803434fb9824668dddd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 14:11:55 +0200 Subject: [PATCH 04/13] bumped Symfony version to 4.2.10 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index fd063881387d8..14257d0f6003d 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.2.9'; - const VERSION_ID = 40209; + const VERSION = '4.2.10-DEV'; + const VERSION_ID = 40210; const MAJOR_VERSION = 4; const MINOR_VERSION = 2; - const RELEASE_VERSION = 9; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 10; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '07/2019'; const END_OF_LIFE = '01/2020'; From 33e743b5f7f1f7e8407091945c93b02b79f83f7b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 14:37:30 +0200 Subject: [PATCH 05/13] bumped Symfony version to 4.3.0 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 785ce496f5d49..0dcdc717d9b22 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.0-RC1'; + const VERSION = '4.3.0-DEV'; const VERSION_ID = 40300; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'RC1'; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2020'; const END_OF_LIFE = '07/2020'; From a662f61e089800b0b4c379a4f64dd49468d431a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilius=20Grigali=C5=ABnas?= Date: Fri, 24 May 2019 11:41:23 +0300 Subject: [PATCH 06/13] [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping Currently BinaryFileResponse, when configured with X-Accel-Redirect sendfile type, will only substitute file paths specified in X-Accel-Mapping. But if the provided file path does not have a defined prefix, then the resulting header will include the absolute path. Nginx expects a valid URI, therefore this will result in an issue that is very hard to detect and debug as it will not show up in error logs and instead the request would just hang for some time and then be re-served without query parameters(?). --- .../Component/HttpFoundation/BinaryFileResponse.php | 9 +++++++-- .../HttpFoundation/Tests/BinaryFileResponseTest.php | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php index cf648dfe9d54f..6c9a995e9a316 100644 --- a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php +++ b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php @@ -227,13 +227,18 @@ public function prepare(Request $request) 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 c89f20d05a498..853b4bb3dfe11 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php @@ -338,6 +338,7 @@ public function getSampleXAccelMappings() return [ ['/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'], + ['/tmp/bar.txt', '"/var/www/"="/files/", "/home/Foo/"="/baz/"', null], ]; } From 36f16e8461290ec24888647ea7bb58759acdab5c Mon Sep 17 00:00:00 2001 From: Vincent Touzet Date: Tue, 28 May 2019 21:17:30 +0200 Subject: [PATCH 07/13] [FrameworkBundle] Add a validation on the messenger section --- .../DependencyInjection/Configuration.php | 4 +++ .../DependencyInjection/ConfigurationTest.php | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 44ed8213e916d..ea64157fde9bc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -1110,6 +1110,10 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode) ->{!class_exists(FullStack::class) && interface_exists(MessageBusInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}() ->fixXmlConfig('transport') ->fixXmlConfig('bus', 'buses') + ->validate() + ->ifTrue(function ($v) { return isset($v['buses']) && \count($v['buses']) > 1 && null === $v['default_bus']; }) + ->thenInvalid('You must specify the "default_bus" if you define more than one bus.') + ->end() ->children() ->arrayNode('routing') ->useAttributeAsKey('message_class') diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 79ebadef28439..3980036006b11 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -188,6 +188,31 @@ public function provideInvalidAssetConfigurationTests() yield [$createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.']; } + public function testItShowANiceMessageIfTwoMessengerBusesAreConfiguredButNoDefaultBus() + { + $expectedMessage = 'You must specify the "default_bus" if you define more than one bus.'; + if (method_exists($this, 'expectException')) { + $this->expectException(InvalidConfigurationException::class); + $this->expectExceptionMessage($expectedMessage); + } else { + $this->setExpectedException(InvalidConfigurationException::class, $expectedMessage); + } + $processor = new Processor(); + $configuration = new Configuration(true); + + $processor->processConfiguration($configuration, [ + 'framework' => [ + 'messenger' => [ + 'default_bus' => null, + 'buses' => [ + 'first_bus' => [], + 'second_bus' => [], + ], + ], + ], + ]); + } + protected static function getBundleDefaultConfig() { return [ From 6eab5d24603a7c9c206c35ea3084dd7cda1a10d4 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Wed, 29 May 2019 08:53:22 +0200 Subject: [PATCH 08/13] [Intl][4.3] Cleanup internal api --- .../Intl/Data/Provider/LanguageDataProvider.php | 14 +------------- .../Intl/Data/Provider/RegionDataProvider.php | 8 +------- .../Intl/Data/Provider/ScriptDataProvider.php | 8 +------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php index fed764d6726e1..0d1bfe61df409 100644 --- a/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php @@ -18,7 +18,7 @@ * * @author Bernhard Schussek * - * @internal + * @internal to be removed in 5.0. */ class LanguageDataProvider { @@ -37,17 +37,11 @@ public function __construct(string $path, BundleEntryReaderInterface $reader) $this->reader = $reader; } - /** - * @internal to be removed in 5.0. - */ public function getLanguages() { return $this->reader->readEntry($this->path, 'meta', ['Languages']); } - /** - * @internal to be removed in 5.0. - */ public function getAliases() { return $this->reader->readEntry($this->path, 'root', ['Aliases']); @@ -62,9 +56,6 @@ public function getName($language, $displayLocale = null) return $this->reader->readEntry($this->path, $displayLocale, ['Names', $language]); } - /** - * @internal to be removed in 5.0. - */ public function getNames($displayLocale = null) { if (null === $displayLocale) { @@ -83,9 +74,6 @@ public function getNames($displayLocale = null) return $languages; } - /** - * @internal to be removed in 5.0. - */ public function getAlpha3Code($language) { return $this->reader->readEntry($this->path, 'meta', ['Alpha2ToAlpha3', $language]); diff --git a/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php index ec16994f63a6f..881529440141d 100644 --- a/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php @@ -18,7 +18,7 @@ * * @author Bernhard Schussek * - * @internal + * @internal to be removed in 5.0. */ class RegionDataProvider { @@ -37,9 +37,6 @@ public function __construct(string $path, BundleEntryReaderInterface $reader) $this->reader = $reader; } - /** - * @internal to be removed in 5.0. - */ public function getRegions() { return $this->reader->readEntry($this->path, 'meta', ['Regions']); @@ -54,9 +51,6 @@ public function getName($region, $displayLocale = null) return $this->reader->readEntry($this->path, $displayLocale, ['Names', $region]); } - /** - * @internal to be removed in 5.0. - */ public function getNames($displayLocale = null) { if (null === $displayLocale) { diff --git a/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php index 3189da13e5aaa..08bc3797262bd 100644 --- a/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php @@ -18,7 +18,7 @@ * * @author Bernhard Schussek * - * @internal + * @internal to be removed in 5.0. */ class ScriptDataProvider { @@ -37,9 +37,6 @@ public function __construct(string $path, BundleEntryReaderInterface $reader) $this->reader = $reader; } - /** - * @internal to be removed in 5.0. - */ public function getScripts() { return $this->reader->readEntry($this->path, 'meta', ['Scripts']); @@ -54,9 +51,6 @@ public function getName($script, $displayLocale = null) return $this->reader->readEntry($this->path, $displayLocale, ['Names', $script]); } - /** - * @internal to be removed in 5.0. - */ public function getNames($displayLocale = null) { if (null === $displayLocale) { From 733f0179049b9ef1f6de43a647f0d672be9901cb Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Wed, 29 May 2019 12:13:42 +0200 Subject: [PATCH 09/13] Fix tests --- .../Extension/Core/Type/TimezoneTypeTest.php | 22 +++++++++++++++++++ .../Constraints/TimezoneValidatorTest.php | 13 ++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php index bded60a7de62f..490e878b7bcd8 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php @@ -122,6 +122,17 @@ public function testIntlTimeZoneInput() */ public function testIntlTimeZoneInputWithBc() { + $reflector = new \ReflectionExtension('intl'); + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches); + $tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0; + + if (!$tzDbVersion || 2017 <= $tzDbVersion) { + $this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion); + } + $form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'intltimezone']); $form->submit('Europe/Saratov'); @@ -134,6 +145,17 @@ public function testIntlTimeZoneInputWithBc() */ public function testIntlTimeZoneInputWithBcAndIntl() { + $reflector = new \ReflectionExtension('intl'); + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches); + $tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0; + + if (!$tzDbVersion || 2017 <= $tzDbVersion) { + $this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion); + } + $form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'intltimezone', 'intl' => true]); $form->submit('Europe/Saratov'); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TimezoneValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TimezoneValidatorTest.php index c5dc5c40d458e..82a521d950a95 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TimezoneValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TimezoneValidatorTest.php @@ -76,7 +76,7 @@ public function getValidTimezones(): iterable yield ['PST8PDT']; yield ['America/Montreal']; - // expired in ICU + // previously expired in ICU yield ['Europe/Saratov']; // standard @@ -316,6 +316,17 @@ public function getDeprecatedTimezones(): iterable */ public function testIntlCompatibility() { + $reflector = new \ReflectionExtension('intl'); + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches); + $tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0; + + if (!$tzDbVersion || 2017 <= $tzDbVersion) { + $this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion); + } + $constraint = new Timezone([ 'message' => 'myMessage', 'intlCompatible' => true, From f4ff47e47e14811fb17ed861d2dea381f21bce82 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 29 May 2019 09:48:30 +0200 Subject: [PATCH 10/13] [Intl] Improve the error message when country code is wrong --- src/Symfony/Component/Intl/Tests/TimezonesTest.php | 9 +++++++++ src/Symfony/Component/Intl/Timezones.php | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/Symfony/Component/Intl/Tests/TimezonesTest.php b/src/Symfony/Component/Intl/Tests/TimezonesTest.php index cc000c148270c..ef922e1de866c 100644 --- a/src/Symfony/Component/Intl/Tests/TimezonesTest.php +++ b/src/Symfony/Component/Intl/Tests/TimezonesTest.php @@ -603,6 +603,15 @@ public function testForCountryCodeWithUnknownCountry() Timezones::forCountryCode('foobar'); } + /** + * @expectedException \Symfony\Component\Intl\Exception\MissingResourceException + * @expectedExceptionMessage Country codes must be in uppercase, but "nl" was passed. Try with "NL" country code instead. + */ + public function testForCountryCodeWithWrongCountryCode() + { + Timezones::forCountryCode('nl'); + } + /** * @expectedException \Symfony\Component\Intl\Exception\MissingResourceException */ diff --git a/src/Symfony/Component/Intl/Timezones.php b/src/Symfony/Component/Intl/Timezones.php index 94afc7186062e..dd72d35925f40 100644 --- a/src/Symfony/Component/Intl/Timezones.php +++ b/src/Symfony/Component/Intl/Timezones.php @@ -109,6 +109,10 @@ public static function forCountryCode(string $country): array return []; } + if (Countries::exists(strtoupper($country))) { + throw new MissingResourceException(sprintf('Country codes must be in uppercase, but "%s" was passed. Try with "%s" country code instead.', $country, strtoupper($country))); + } + throw $e; } } From 7f00a7475481a462ac0c7c14802afca138c3502b Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Thu, 30 May 2019 05:17:01 +0200 Subject: [PATCH 11/13] [FrameworkBundle] fix test fixture using deprecated controller and add missing deprecation --- .../EventListener/ResolveControllerNameSubscriber.php | 4 +++- .../EventListener/ResolveControllerNameSubscriberTest.php | 3 +++ .../Tests/Functional/app/templates/fragment.html.twig | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php b/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php index e68ef896ddfd7..709df23075a54 100644 --- a/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php +++ b/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php @@ -37,7 +37,9 @@ public function onKernelRequest(GetResponseEvent $event) $controller = $event->getRequest()->attributes->get('_controller'); if (\is_string($controller) && false === strpos($controller, '::') && 2 === substr_count($controller, ':')) { // controller in the a:b:c notation then - $event->getRequest()->attributes->set('_controller', $this->parser->parse($controller, false)); + $event->getRequest()->attributes->set('_controller', $parsedNotation = $this->parser->parse($controller, false)); + + @trigger_error(sprintf('Referencing controllers with %s is deprecated since Symfony 4.1, use "%s" instead.', $controller, $parsedNotation), E_USER_DEPRECATED); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php index 084e63ca95ea5..c8bc4f8a854c5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php @@ -20,6 +20,9 @@ class ResolveControllerNameSubscriberTest extends TestCase { + /** + * @group legacy + */ public function testReplacesControllerAttribute() { $parser = $this->getMockBuilder(ControllerNameParser::class)->disableOriginalConstructor()->getMock(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/templates/fragment.html.twig b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/templates/fragment.html.twig index 4dea4b360b68b..6576e325a2c23 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/templates/fragment.html.twig +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/templates/fragment.html.twig @@ -1,7 +1,7 @@ -{{ render(controller('TestBundle:Fragment:inlined', {'options': {'bar': bar, 'eleven': 11}})) }} +{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::inlinedAction', {'options': {'bar': bar, 'eleven': 11}})) }} -- -{{ render(controller('TestBundle:Fragment:customformat', {'_format': 'html'})) }} +{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customformatAction', {'_format': 'html'})) }} -- -{{ render(controller('TestBundle:Fragment:customlocale', {'_locale': 'es'})) }} +{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customlocaleAction', {'_locale': 'es'})) }} -- -{{ app.request.setLocale('fr') }}{{ render(controller('TestBundle:Fragment:forwardlocale')) -}} +{{ app.request.setLocale('fr') }}{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::forwardlocaleAction')) -}} From 65531c84992b5291db71c1f75108bef86fb769a2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 May 2019 08:20:59 +0200 Subject: [PATCH 12/13] updated CHANGELOG for 4.3.0 --- CHANGELOG-4.3.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG-4.3.md b/CHANGELOG-4.3.md index 9f06cb0767017..8f905cd7afcc5 100644 --- a/CHANGELOG-4.3.md +++ b/CHANGELOG-4.3.md @@ -7,6 +7,10 @@ in 4.3 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.3.0...v4.3.1 +* 4.3.0 (2019-05-30) + + * bug #31654 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping (vilius-g) + * 4.3.0-RC1 (2019-05-28) * bug #31650 Create an abstract HTTP transport and extend it in all HTTP transports (bocharsky-bw) From 090c029f21e0eeef768b66dbfa8e9961a24ab8ae Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 May 2019 08:21:08 +0200 Subject: [PATCH 13/13] updated VERSION for 4.3.0 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 0dcdc717d9b22..e0154b7d23bb5 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.0-DEV'; + const VERSION = '4.3.0'; const VERSION_ID = 40300; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2020'; const END_OF_LIFE = '07/2020';