summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-09-06 20:20:34 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2013-09-06 20:20:34 +0200
commit73e267b8033bc9da70dc4cd0e51f9e77278aecff (patch)
tree63601bb472f011fe3c4aad6877de9967a6ec21fc
parent66940a64ab627badd5df3816d6613d2e21753850 (diff)
parent21ac0805b6ab455862ecadad5f1bfb9a524c4087 (diff)
downloadsymfony-security-73e267b8033bc9da70dc4cd0e51f9e77278aecff.zip
symfony-security-73e267b8033bc9da70dc4cd0e51f9e77278aecff.tar.gz
symfony-security-73e267b8033bc9da70dc4cd0e51f9e77278aecff.tar.bz2
Merge branch '2.2' into 2.3
* 2.2: Fixing singular form for kisses, accesses and addresses. fixed some circular references [Security] fixed a leak in ExceptionListener [Security] fixed a leak in the ContextListener Ignore posix_istatty warnings typos [HttpKernel] fixed route parameters storage in the Request data collector (closes #8867) Return BC compatibility for `@Route` parameters and default values Conflicts: src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php src/Symfony/Component/Console/Application.php
-rw-r--r--Http/Firewall/ContextListener.php4
-rw-r--r--Http/Firewall/ExceptionListener.php4
2 files changed, 7 insertions, 1 deletions
diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php
index 8c71876..81ccbdc 100644
--- a/Http/Firewall/ContextListener.php
+++ b/Http/Firewall/ContextListener.php
@@ -38,6 +38,7 @@ class ContextListener implements ListenerInterface
private $logger;
private $userProviders;
private $dispatcher;
+ private $registered;
public function __construct(SecurityContextInterface $context, array $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
@@ -65,8 +66,9 @@ class ContextListener implements ListenerInterface
*/
public function handle(GetResponseEvent $event)
{
- if (null !== $this->dispatcher && HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
+ if (!$this->registered && null !== $this->dispatcher && HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
$this->dispatcher->addListener(KernelEvents::RESPONSE, array($this, 'onKernelResponse'));
+ $this->registered = true;
}
$request = $event->getRequest();
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php
index 6554595..abbb460 100644
--- a/Http/Firewall/ExceptionListener.php
+++ b/Http/Firewall/ExceptionListener.php
@@ -76,6 +76,10 @@ class ExceptionListener
*/
public function onKernelException(GetResponseForExceptionEvent $event)
{
+ // we need to remove ourselves as the exception listener can be
+ // different depending on the Request
+ $event->getDispatcher()->removeListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'));
+
$exception = $event->getException();
$request = $event->getRequest();