diff options
Diffstat (limited to 'Http/HttpUtils.php')
-rw-r--r-- | Http/HttpUtils.php | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php index cac130e..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,27 +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()); - - if (isset($parameters['_locale'])) { - $context->setParameter('_locale', $parameters['_locale']); - } elseif ($session = $request->getSession()) { - $context->setParameter('_locale', $session->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) { |