summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-11-17 07:41:20 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2011-11-17 07:41:20 +0100
commit1ca3caca13eb33e182d235a79c1bac3342a72a5c (patch)
tree558712a47bbd099c5f46527843bb7a8f2cc01c56
parent3841b18484acd18eb20f2b0352c282bf525c9c06 (diff)
parent34a3094f189524cfc99ad26126088eca6cbdc67e (diff)
downloadsymfony-security-1ca3caca13eb33e182d235a79c1bac3342a72a5c.zip
symfony-security-1ca3caca13eb33e182d235a79c1bac3342a72a5c.tar.gz
symfony-security-1ca3caca13eb33e182d235a79c1bac3342a72a5c.tar.bz2
merged branch snc/login-referer (PR #2518)
Commits ------- f9a65ba Redirect to default_target_path if use_referer is true and the referer is the login_path. Discussion ---------- Login redirect Bug fix: no Feature addition: no Backwards compatibility break: yes Symfony2 tests pass: yes Redirect to default_target_path if use_referer is true and the referer is the login_path. --------------------------------------------------------------------------- by Seldaek at 2011/10/30 10:52:38 -0700 :+1: --------------------------------------------------------------------------- by stealth35 at 2011/10/30 11:04:16 -0700 @snc BC break ? --------------------------------------------------------------------------- by snc at 2011/10/30 12:11:39 -0700 Well I'm sure it is never intended by a developer to be redirected to the login page after logging in but it could be possible that the controller which displays the login form handles this case, so my change would break it.
-rw-r--r--Http/Firewall/AbstractAuthenticationListener.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php
index 5270e8d..9f91a39 100644
--- a/Http/Firewall/AbstractAuthenticationListener.php
+++ b/Http/Firewall/AbstractAuthenticationListener.php
@@ -273,7 +273,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
return $targetUrl;
}
- if ($this->options['use_referer'] && $targetUrl = $request->headers->get('Referer')) {
+ if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $request->getUriForPath($this->options['login_path'])) {
return $targetUrl;
}