소스 검색

storing localized targetPath in a string as opposed to updating the attribute

Ned Schwartz 14 년 전
부모
커밋
8fd4158468
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      src/Symfony/Component/Security/Http/Firewall/LogoutListener.php

+ 3 - 4
src/Symfony/Component/Security/Http/Firewall/LogoutListener.php

@@ -69,8 +69,8 @@ class LogoutListener implements ListenerInterface
     {
         $request = $event->getRequest();
 
-        $this->targetUrl = str_replace('{_locale}', $request->getSession()->getLocale(), $this->targetUrl);
-
+        $targetUrl = str_replace('{_locale}', $request->getSession()->getLocale(), $this->targetUrl);
+        
         if ($this->logoutPath !== $request->getPathInfo()) {
             return;
         }
@@ -82,7 +82,7 @@ class LogoutListener implements ListenerInterface
                 throw new \RuntimeException('Logout Success Handler did not return a Response.');
             }
         } else {
-            $response = new RedirectResponse(0 !== strpos($this->targetUrl, 'http') ? $request->getUriForPath($this->targetUrl) : $this->targetUrl, 302);
+            $response = new RedirectResponse(0 !== strpos($targetUrl, 'http') ? $request->getUriForPath($targetUrl) : $targetUrl, 302);
         }
 
         // handle multiple logout attempts gracefully
@@ -96,4 +96,3 @@ class LogoutListener implements ListenerInterface
 
         $event->setResponse($response);
     }
-}