From ac1448f573c7918b01b13bdc57bcbf0377d5907a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 7 Jul 2011 10:17:17 +0200 Subject: [PATCH] [Routing] Revert to rawurlencode + whitelisting of '/' --- src/Symfony/Component/Routing/Generator/UrlGenerator.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Routing/Generator/UrlGenerator.php b/src/Symfony/Component/Routing/Generator/UrlGenerator.php index b0d3e0927cd29..eabc183ad8510 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/src/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -28,11 +28,8 @@ class UrlGenerator implements UrlGeneratorInterface { protected $context; - protected $escapedChars = array( - '%' => '%25', - '+' => '%2B', - '#' => '%23', - '?' => '%3F', + protected $decodedChars = array( + '%2F' => '/', ); private $routes; @@ -131,7 +128,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa } if (!$isEmpty || !$optional) { - $url = $token[1].strtr($tparams[$token[3]], $this->escapedChars).$url; + $url = $token[1].strtr(rawurlencode($tparams[$token[3]]), $this->decodedChars).$url; } $optional = false;