summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-11-17 10:17:51 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2011-11-17 14:22:53 +0100
commit817f9491b541d450e89aa94190b08d5ae4d1cf00 (patch)
treec34cdde96da5a3ad45ecea76076af19a589eb9eb
parent1ca3caca13eb33e182d235a79c1bac3342a72a5c (diff)
downloadsymfony-security-817f9491b541d450e89aa94190b08d5ae4d1cf00.zip
symfony-security-817f9491b541d450e89aa94190b08d5ae4d1cf00.tar.gz
symfony-security-817f9491b541d450e89aa94190b08d5ae4d1cf00.tar.bz2
changed priorities for kernel.request listeners
The Firewall is now executed after the Router. This was needed to have access to the locale and other request attributes that are set by the Router. This change implies that all Firewall specific URLs have proper (empty) routes like `/login_check` and `/logout`.
-rw-r--r--Http/HttpUtils.php19
1 files changed, 0 insertions, 19 deletions
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index b31fcf5..f62f84d 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -52,7 +52,6 @@ class HttpUtils
if ('/' === $path[0]) {
$path = $request->getUriForPath($path);
} elseif (0 !== strpos($path, 'http')) {
- $this->resetLocale($request);
$path = $this->generateUrl($path, true);
}
@@ -70,7 +69,6 @@ class HttpUtils
public function createRequest(Request $request, $path)
{
if ($path && '/' !== $path[0] && 0 !== strpos($path, 'http')) {
- $this->resetLocale($request);
$path = $this->generateUrl($path, true);
}
if (0 !== strpos($path, 'http')) {
@@ -120,23 +118,6 @@ class HttpUtils
return $path === $request->getPathInfo();
}
- // hack (don't have a better solution for now)
- private function resetLocale(Request $request)
- {
- $context = $this->router->getContext();
- if ($context->getParameter('_locale')) {
- return;
- }
-
- try {
- $parameters = $this->router->match($request->getPathInfo());
-
- $context->setParameter('_locale', isset($parameters['_locale']) ? $parameters['_locale'] : $request->getLocale());
- } catch (\Exception $e) {
- // let's hope user doesn't use the locale in the path
- }
- }
-
private function generateUrl($route, $absolute = false)
{
if (null === $this->router) {