Show fallback error page when framework.error_controller is null
This commit is contained in:
parent
b00b633665
commit
8eea11cc26
@ -603,7 +603,7 @@ class ErrorHandler
|
|||||||
$handlerException = $handlerException ?: $exception;
|
$handlerException = $handlerException ?: $exception;
|
||||||
} catch (\Throwable $handlerException) {
|
} catch (\Throwable $handlerException) {
|
||||||
}
|
}
|
||||||
if ($exception === $handlerException) {
|
if ($exception === $handlerException && null === $this->exceptionHandler) {
|
||||||
self::$reservedMemory = null; // Disable the fatal error handler
|
self::$reservedMemory = null; // Disable the fatal error handler
|
||||||
throw $exception; // Give back $exception to the native handler
|
throw $exception; // Give back $exception to the native handler
|
||||||
}
|
}
|
||||||
@ -706,7 +706,7 @@ class ErrorHandler
|
|||||||
$exception = FlattenException::createFromThrowable($exception);
|
$exception = FlattenException::createFromThrowable($exception);
|
||||||
$statusCode = $exception->getStatusCode();
|
$statusCode = $exception->getStatusCode();
|
||||||
$headers = $exception->getHeaders();
|
$headers = $exception->getHeaders();
|
||||||
$response = (new HtmlErrorRenderer(true))->render($exception);
|
$response = (new HtmlErrorRenderer(0 !== $this->scopedErrors))->render($exception);
|
||||||
} else {
|
} else {
|
||||||
$message = htmlspecialchars($exception->getMessage(), ENT_COMPAT | ENT_SUBSTITUTE, $charset);
|
$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);
|
$response = sprintf('<!DOCTYPE html><html><head><meta charset="%s" /><meta name="robots" content="noindex,nofollow" /></head><body>%s</body></html>', $charset, $message);
|
||||||
|
Reference in New Issue
Block a user