Преглед на файлове

[Security/Http] {_locale} can be used as placeholder in target path generation

fixes #861
Johannes Schmitt преди 14 години
родител
ревизия
0acffb1a1a
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php

+ 1 - 1
src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php

@@ -222,7 +222,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
         if (null !== $this->successHandler) {
             $response = $this->successHandler->onAuthenticationSuccess($request, $token);
         } else {
-            $path = $this->determineTargetUrl($request);
+            $path = strtr($this->determineTargetUrl($request), '{_locale}', $session->getLocale());
             $response = new RedirectResponse(0 !== strpos($path, 'http') ? $request->getUriForPath($path) : $path, 302);
         }