diff --git a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php index 0f81d1bf6c..b2c8862b72 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php +++ b/src/Symfony/Component/Security/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();