summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-06-08 10:36:14 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2011-06-08 10:36:14 +0200
commit6e7f927c14efea0b072f143840c77ca21bcc4472 (patch)
tree7f0ac96f5f57c6e229bc1aef7e001a35b1e996e4 /Http
parentd39b5cc88441b4d0966f204a780fe1cb9663b6ab (diff)
downloadsymfony-security-6e7f927c14efea0b072f143840c77ca21bcc4472.zip
symfony-security-6e7f927c14efea0b072f143840c77ca21bcc4472.tar.gz
symfony-security-6e7f927c14efea0b072f143840c77ca21bcc4472.tar.bz2
[Security] fixed sub-requests creation (closes #1212)
Diffstat (limited to 'Http')
-rw-r--r--Http/EntryPoint/FormAuthenticationEntryPoint.php4
-rw-r--r--Http/Firewall/AbstractAuthenticationListener.php2
-rw-r--r--Http/Firewall/ExceptionListener.php2
3 files changed, 5 insertions, 3 deletions
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php
index 057de2d..6301606 100644
--- a/Http/EntryPoint/FormAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php
@@ -50,7 +50,9 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
{
$path = str_replace('{_locale}', $request->getSession()->getLocale(), $this->loginPath);
if ($this->useForward) {
- return $this->httpKernel->handle(Request::create($path), HttpKernelInterface::SUB_REQUEST);
+ $subRequest = Request::create($path, 'get', array(), $request->cookies->all(), array(), $request->server->all());
+
+ return $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
}
return new RedirectResponse(0 !== strpos($path, 'http') ? $request->getUriForPath($path) : $path, 302);
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php
index 441d120..c35ab35 100644
--- a/Http/Firewall/AbstractAuthenticationListener.php
+++ b/Http/Firewall/AbstractAuthenticationListener.php
@@ -203,7 +203,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
$this->logger->debug(sprintf('Forwarding to %s', $path));
}
- $subRequest = Request::create($path);
+ $subRequest = Request::create($path, 'get', array(), $request->cookies->all(), array(), $request->server->all());
$subRequest->attributes->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);
return $event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php
index d58c0c2..bedbe4a 100644
--- a/Http/Firewall/ExceptionListener.php
+++ b/Http/Firewall/ExceptionListener.php
@@ -115,7 +115,7 @@ class ExceptionListener
return;
}
- $subRequest = Request::create($this->errorPage);
+ $subRequest = Request::create($this->errorPage, 'get', array(), $request->cookies->all(), array(), $request->server->all());
$subRequest->attributes->set(SecurityContextInterface::ACCESS_DENIED_ERROR, $exception);
$response = $event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);