X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FSpecial%2FHTTPException.php;h=36c770fba78d356493cdd809f2f4230d02c8c1c4;hb=d48d3d1db28572e055689097d923b6cf389f9ec9;hp=5c6ff79ae6188385f95f2246993f05c88d8ff16e;hpb=358baa9f62b87617992602d3e3a80586ad98c444;p=friendica.git diff --git a/src/Module/Special/HTTPException.php b/src/Module/Special/HTTPException.php index 5c6ff79ae6..36c770fba7 100644 --- a/src/Module/Special/HTTPException.php +++ b/src/Module/Special/HTTPException.php @@ -36,7 +36,7 @@ class HTTPException 500 => L10n::t('Internal Server Error'), 503 => L10n::t('Service Unavailable'), ]; - $title = defaults($titles, $e->getCode(), 'Error ' . $e->getCode()); + $title = ($titles[$e->getCode()] ?? '') ?: 'Error ' . $e->getCode(); if (empty($message)) { // Explanations are taken from https://en.wikipedia.org/wiki/List_of_HTTP_status_codes @@ -49,17 +49,17 @@ class HTTPException 503 => L10n::t('The server is currently unavailable (because it is overloaded or down for maintenance). Please try again later.'), ]; - $message = defaults($explanation, $e->getCode(), ''); + $message = $explanation[$e->getCode()] ?? ''; } - return ['$title' => $title, '$description' => $message]; + return ['$title' => $title, '$message' => $message, '$back' => L10n::t('Go back')]; } /** * Displays a bare message page with no theming at all. * * @param \Friendica\Network\HTTPException $e - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ public static function rawContent(\Friendica\Network\HTTPException $e) { @@ -78,7 +78,7 @@ class HTTPException * * @param \Friendica\Network\HTTPException $e * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ public static function content(\Friendica\Network\HTTPException $e) {