]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Special/HTTPException.php
Merge pull request #7848 from annando/mail-hooks
[friendica.git] / src / Module / Special / HTTPException.php
index 5c6ff79ae6188385f95f2246993f05c88d8ff16e..36c770fba78d356493cdd809f2f4230d02c8c1c4 100644 (file)
@@ -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)
        {