merged branch Tobion/fix-double-encoding (PR #6363)
This PR was merged into the 2.0 branch.
Commits
-------
8b2c17f
fix double-decoding in the routing system
Discussion
----------
fix double-decoding in the routing system
@fabpot @vicb This should fix it. You know what ;) Don't want to leak more information.
And the good thing, it's no hack nor does it break BC.
This commit is contained in:
commit
d90e55cbb3
@ -70,7 +70,10 @@ class RouterListener
|
||||
|
||||
// add attributes based on the path info (routing)
|
||||
try {
|
||||
$parameters = $this->router->match($request->getPathInfo());
|
||||
// The path is returned in decoded form from the request, so we need to
|
||||
// encode it again as the router applies its own decoding. This prevents
|
||||
// double-decoding.
|
||||
$parameters = $this->router->match(urlencode($request->getPathInfo()));
|
||||
|
||||
if (null !== $this->logger) {
|
||||
$this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], $this->parametersToString($parameters)));
|
||||
|
@ -107,7 +107,7 @@ class HttpUtils
|
||||
{
|
||||
if ('/' !== $path[0]) {
|
||||
try {
|
||||
$parameters = $this->router->match($request->getPathInfo());
|
||||
$parameters = $this->router->match(urlencode($request->getPathInfo()));
|
||||
|
||||
return $path === $parameters['_route'];
|
||||
} catch (MethodNotAllowedException $e) {
|
||||
@ -129,7 +129,7 @@ class HttpUtils
|
||||
}
|
||||
|
||||
try {
|
||||
$parameters = $this->router->match($request->getPathInfo());
|
||||
$parameters = $this->router->match(urlencode($request->getPathInfo()));
|
||||
|
||||
if (isset($parameters['_locale'])) {
|
||||
$context->setParameter('_locale', $parameters['_locale']);
|
||||
|
Reference in New Issue
Block a user