Skip to content

Commit

Permalink
Show fallback error page when framework.error_controller is null
Browse files Browse the repository at this point in the history
  • Loading branch information
yceruto committed Sep 23, 2019
1 parent b00b633 commit 8eea11c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/ErrorHandler/ErrorHandler.php
Expand Up @@ -603,7 +603,7 @@ public function handleException($exception, array $error = null)
$handlerException = $handlerException ?: $exception;
} catch (\Throwable $handlerException) {
}
if ($exception === $handlerException) {
if ($exception === $handlerException && null === $this->exceptionHandler) {
self::$reservedMemory = null; // Disable the fatal error handler
throw $exception; // Give back $exception to the native handler
}
Expand Down Expand Up @@ -706,7 +706,7 @@ private function sendPhpResponse(\Throwable $exception)
$exception = FlattenException::createFromThrowable($exception);
$statusCode = $exception->getStatusCode();
$headers = $exception->getHeaders();
$response = (new HtmlErrorRenderer(true))->render($exception);
$response = (new HtmlErrorRenderer(0 !== $this->scopedErrors))->render($exception);
} else {
$message = htmlspecialchars($exception->getMessage(), ENT_COMPAT | ENT_SUBSTITUTE, $charset);
$response = sprintf('<!DOCTYPE html><html><head><meta charset="%s" /><meta name="robots" content="noindex,nofollow" /></head><body>%s</body></html>', $charset, $message);
Expand Down

0 comments on commit 8eea11c

Please sign in to comment.