Quellcode durchsuchen

[Security] forward the entire access denied exception instead of only the message

Johannes Schmitt vor 14 Jahren
Ursprung
Commit
b67a1dd677
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

+ 1 - 1
src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

@@ -124,7 +124,7 @@ class ExceptionListener implements ListenerInterface
                         }
                         }
 
 
                         $subRequest = Request::create($this->errorPage);
                         $subRequest = Request::create($this->errorPage);
-                        $subRequest->attributes->set(SecurityContextInterface::ACCESS_DENIED_ERROR, $exception->getMessage());
+                        $subRequest->attributes->set(SecurityContextInterface::ACCESS_DENIED_ERROR, $exception);
 
 
                         $response = $event->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
                         $response = $event->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
                         $response->setStatusCode(403);
                         $response->setStatusCode(403);