mirror of
https://github.com/friendica/friendica
synced 2024-11-19 06:23:40 +00:00
Fix WSOD when Renderer throws exception
`HTTPException` builds a simple static version of error page if `Renderer` throws any exception while rendering the error page.
This commit is contained in:
parent
bd246b8cc2
commit
704bd95608
1 changed files with 11 additions and 2 deletions
|
@ -70,8 +70,17 @@ class HTTPException
|
|||
$content = '';
|
||||
|
||||
if ($e->getCode() >= 400) {
|
||||
$tpl = Renderer::getMarkupTemplate('http_status.tpl');
|
||||
$content = Renderer::replaceMacros($tpl, self::getVars($e));
|
||||
$vars = self::getVars($e);
|
||||
try {
|
||||
$tpl = Renderer::getMarkupTemplate('http_status.tpl');
|
||||
$content = Renderer::replaceMacros($tpl, $vars);
|
||||
} catch (\Exception $e) {
|
||||
$content = "<h1>{$vars['$title']}</h1><p>{$vars['$message']}</p>";
|
||||
if (DI::app()->isSiteAdmin()) {
|
||||
$content .= "<p>{$vars['$thrown']}</p>";
|
||||
$content .= "<pre>{$vars['$trace']}</pre>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System::httpError($e->getCode(), $e->getDescription(), $content);
|
||||
|
|
Loading…
Reference in a new issue