8000 [Security] Avoid unnecessary route lookup for empty logout path by ro0NL · Pull Request #22584 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Avoid unnecessary route lookup for empty logout path #22584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Security] Avoid unnecessary route lookup for empty logout path
  • Loading branch information
ro0NL committed Apr 29, 2017
commit 2967807b14dbc6af8b0e8732889b8da04e1af64b
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ public function handle(GetResponseEvent $event)
*/
protected function requiresLogout(Request $request)
{
return $this->httpUtils->checkRequestPath($request, $this->options['logout_path']);
return isset($this->options['logout_path']) && $this->httpUtils->checkRequestPath($request, $this->options['logout_path']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ private function generateLogoutUrl($key, $referenceType)

list($logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager) = $this->listeners[$key];

if (null === $logoutPath) {
throw new \LogicException('Unable to generate the logout URL without a path.');
}

$parameters = null !== $csrfTokenManager ? array($csrfParameter => (string) $csrfTokenManager->getToken($csrfTokenId)) : array();

if ('/' === $logoutPath[0]) {
Expand Down
0