diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 8da2e257a8..350a54360e 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -385,7 +385,7 @@ trait RedisTrait return true; } - if ($this->redis instanceof \Predis\Client) { + if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) { $this->pipeline(function () use ($ids) { foreach ($ids as $id) { yield 'del' => [$id]; diff --git a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php index 8d7b0cb3a3..1d1ae7dfcb 100644 --- a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php @@ -48,7 +48,7 @@ class PhpFileLoader extends FileLoader if (\is_object($result) && \is_callable($result)) { $collection = new RouteCollection(); - $result(new RoutingConfigurator($collection, $this, $path, $file), $this); + $result(new RoutingConfigurator($collection, $this, $path, $file)); } else { $collection = $result; } diff --git a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php index 241e47f033..0632a17823 100644 --- a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php @@ -268,6 +268,7 @@ class XmlFileLoader extends FileLoader $prefixes = []; $paths = []; + /** @var \DOMElement $n */ foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) { if ($node !== $n->parentNode) { continue; @@ -292,7 +293,7 @@ class XmlFileLoader extends FileLoader $requirements[$n->getAttribute('key')] = trim($n->textContent); break; case 'option': - $options[$n->getAttribute('key')] = trim($n->textContent); + $options[$n->getAttribute('key')] = XmlUtils::phpize(trim($n->textContent)); break; case 'condition': $condition = trim($n->textContent); diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/localized/utf8.xml b/src/Symfony/Component/Routing/Tests/Fixtures/localized/utf8.xml new file mode 100644 index 0000000000..95aff20cfe --- /dev/null +++ b/src/Symfony/Component/Routing/Tests/Fixtures/localized/utf8.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php index f40b155d78..c4fe699a40 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php @@ -83,6 +83,26 @@ class XmlFileLoaderTest extends TestCase } } + public function testUtf8Route() + { + $loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/localized'])); + $routeCollection = $loader->load('utf8.xml'); + $routes = $routeCollection->all(); + + $this->assertCount(2, $routes, 'Two routes are loaded'); + $this->assertContainsOnly('Symfony\Component\Routing\Route', $routes); + + $utf8Route = $routeCollection->get('app_utf8'); + + $this->assertSame('/utf8', $utf8Route->getPath()); + $this->assertTrue($utf8Route->getOption('utf8'), 'Must be utf8'); + + $noUtf8Route = $routeCollection->get('app_no_utf8'); + + $this->assertSame('/no-utf8', $noUtf8Route->getPath()); + $this->assertFalse($noUtf8Route->getOption('utf8'), 'Must not be utf8'); + } + public function testLoadLocalized() { $loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures'])); diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf index 40dd63e293..b3e8f0f42f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf @@ -318,6 +318,22 @@ Error Fel + + This is not a valid UUID. + Detta är inte ett giltigt UUID. + + + This value should be a multiple of {{ compared_value }}. + Detta värde ska vara en multipel av {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Denna BIC-koden är inte associerad med IBAN {{ iban }}. + + + This value should be valid JSON. + Detta värde ska vara giltig JSON. +