summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2012-12-11 11:41:17 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2012-12-11 11:41:51 +0100
commit94149fa4eadb815a898537129c7ac2a512fd721e (patch)
tree7464bea5bb8cfcdc0711a8c3b8d4234410f6c9b2
parent7c66d5298e8a153f3c3a658543ca2a699c0cb98b (diff)
parent78e25f39b81ccadc5ead77f2c1e1099492875a9c (diff)
downloadsymfony-security-94149fa4eadb815a898537129c7ac2a512fd721e.zip
symfony-security-94149fa4eadb815a898537129c7ac2a512fd721e.tar.gz
symfony-security-94149fa4eadb815a898537129c7ac2a512fd721e.tar.bz2
Merge branch '2.1'
* 2.1: fixed CS fixed CS [Security] fixed path info encoding (closes #6040, closes #5695) [HttpFoundation] added some tests for the previous merge and removed dead code (closes #6037) Improved Cache-Control header when no-cache is sent removed unneeded comment Fix to allow null values in labels array fix date in changelog removed the Travis icon (as this is not stable enough -- many false positive, closes #6186) Revert "merged branch gajdaw/finder_splfileinfo_fpassthu (PR #4751)" (closes #6224) Fixed a typo Fixed: HeaderBag::parseCacheControl() not parsing quoted zero correctly [Form] Fix const inside an anonymous function [Config] Loader::import must return imported data [DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text" [HttpFoundation] fixed a small regression Conflicts: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
-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