Fixed exception display when database is unavailable
authorAlexander Ebert <ebert@woltlab.com>
Mon, 21 Mar 2016 12:10:30 +0000 (13:10 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 21 Mar 2016 12:10:30 +0000 (13:10 +0100)
wcfsetup/install/files/lib/core.functions.php

index a54ec7bb4d0fd0bdbee2573b4dd9d4aac36c0a67..b7929b326d1958039093e5e6cda46162edd2c649 100644 (file)
@@ -102,9 +102,11 @@ namespace wcf\functions\exception {
                $exceptionTitle = $exceptionSubtitle = $exceptionExplanation = '';
                $logFile = sanitizePath($logFile);
                try {
-                       $exceptionTitle = WCF::getLanguage()->get('wcf.global.exception.title', true);
-                       $exceptionSubtitle = str_replace('{$exceptionID}', $exceptionID, WCF::getLanguage()->get('wcf.global.exception.subtitle', true));
-                       $exceptionExplanation= str_replace('{$logFile}', $logFile, WCF::getLanguage()->get('wcf.global.exception.explanation', true));
+                       if (WCF::getLanguage() !== null) {
+                               $exceptionTitle = WCF::getLanguage()->get('wcf.global.exception.title', true);
+                               $exceptionSubtitle = str_replace('{$exceptionID}', $exceptionID, WCF::getLanguage()->get('wcf.global.exception.subtitle', true));
+                               $exceptionExplanation = str_replace('{$logFile}', $logFile, WCF::getLanguage()->get('wcf.global.exception.explanation', true));
+                       }
                }
                catch (\Exception $e) {
                        // ignore