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

This commit is contained in:
Ned Schwartz 2011-06-10 14:32:10 -07:00
parent 17b7b558ce
commit 8fd4158468

View File

@ -69,7 +69,7 @@ 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);
}
}