Skip to content

Commit

Permalink
[Routing] Add # and ? to escaped chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 7, 2011
1 parent 7eec2ca commit 6039569
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Symfony/Component/Routing/Generator/UrlGenerator.php
Expand Up @@ -28,6 +28,12 @@
class UrlGenerator implements UrlGeneratorInterface
{
protected $context;
protected $escapedChars = array(
'%' => '%25',
'+' => '%2B',
'#' => '%23',
'?' => '%3F',
);

private $routes;
private $cache;
Expand Down Expand Up @@ -125,7 +131,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
}

if (!$isEmpty || !$optional) {
$url = $token[1].strtr($tparams[$token[3]], array('%'=>'%25', '+'=>'%2B')).$url;
$url = $token[1].strtr($tparams[$token[3]], $this->escapedChars).$url;
}

$optional = false;
Expand Down

0 comments on commit 6039569

Please sign in to comment.