summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Http/Authentication/DefaultAuthenticationSuccessHandler.php1
-rw-r--r--Http/Firewall/ContextListener.php1
-rw-r--r--Http/HttpUtils.php2
-rw-r--r--Tests/Http/HttpUtilsTest.php5
4 files changed, 7 insertions, 2 deletions
diff --git a/Http/Authentication/DefaultAuthenticationSuccessHandler.php b/Http/Authentication/DefaultAuthenticationSuccessHandler.php
index dc7cbe5..dd7a7d5 100644
--- a/Http/Authentication/DefaultAuthenticationSuccessHandler.php
+++ b/Http/Authentication/DefaultAuthenticationSuccessHandler.php
@@ -58,7 +58,6 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle
return $this->httpUtils->createRedirectResponse($request, $this->determineTargetUrl($request));
}
-
/**
* Get the provider key.
*
diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php
index b1ba24b..fddd3c7 100644
--- a/Http/Firewall/ContextListener.php
+++ b/Http/Firewall/ContextListener.php
@@ -75,6 +75,7 @@ class ContextListener implements ListenerInterface
if (null === $session || null === $token = $session->get('_security_'.$this->contextKey)) {
$this->context->setToken(null);
+
return;
}
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index 1c87e77..76cfc6a 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -106,7 +106,7 @@ class HttpUtils
}
}
- return $path === $request->getPathInfo();
+ return $path === rawurldecode($request->getPathInfo());
}
/**
diff --git a/Tests/Http/HttpUtilsTest.php b/Tests/Http/HttpUtilsTest.php
index a30051f..fc1b754 100644
--- a/Tests/Http/HttpUtilsTest.php
+++ b/Tests/Http/HttpUtilsTest.php
@@ -97,6 +97,11 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($utils->checkRequestPath($this->getRequest(), '/'));
$this->assertFalse($utils->checkRequestPath($this->getRequest(), '/foo'));
+ $this->assertTrue($utils->checkRequestPath($this->getRequest('/foo%20bar'), '/foo bar'));
+ // Plus must not decoded to space
+ $this->assertTrue($utils->checkRequestPath($this->getRequest('/foo+bar'), '/foo+bar'));
+ // Checking unicode
+ $this->assertTrue($utils->checkRequestPath($this->getRequest(urlencode('/вход')), '/вход'));
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$urlMatcher