Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c061b45

Browse files
committed
merged branch Seldaek/urlgen (PR symfony#1573)
Commits ------- ac1448f [Routing] Revert to rawurlencode + whitelisting of '/' Discussion ---------- [Routing] Revert to rawurlencode + whitelisting of '/' After more discussion on 761724a - sorry you merged too fast for once ;)
2 parents cce2bc5 + ac1448f commit c061b45

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Symfony/Component/Routing/Generator/UrlGenerator.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@
2828
class UrlGenerator implements UrlGeneratorInterface
2929
{
3030
protected $context;
31-
protected $escapedChars = array(
32-
'%' => '%25',
33-
'+' => '%2B',
34-
'#' => '%23',
35-
'?' => '%3F',
31+
protected $decodedChars = array(
32+
'%2F' => '/',
3633
);
3734

3835
private $routes;
@@ -131,7 +128,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
131128
}
132129

133130
if (!$isEmpty || !$optional) {
134-
$url = $token[1].strtr($tparams[$token[3]], $this->escapedChars).$url;
131+
$url = $token[1].strtr(rawurlencode($tparams[$token[3]]), $this->decodedChars).$url;
135132
}
136133

137134
$optional = false;

0 commit comments

Comments
 (0)