Fixed usage of disabled languages
authorMarcel Werk <burntime@woltlab.com>
Wed, 1 Feb 2017 16:53:51 +0000 (17:53 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 1 Feb 2017 16:53:51 +0000 (17:53 +0100)
wcfsetup/install/files/lib/system/WCF.class.php

index 987c1ae0ba775459a640ad31b48939c99b70c999..1127cb54cb40edd320617f9ab1d6c9f1c820fcfd 100644 (file)
@@ -657,7 +657,9 @@ class WCF {
         * @param       integer         $languageID
         */
        public static final function setLanguage($languageID) {
-               if (!$languageID) $languageID = LanguageFactory::getInstance()->getDefaultLanguageID();
+               if (!$languageID || LanguageFactory::getInstance()->getLanguage($languageID) === null) {
+                       $languageID = LanguageFactory::getInstance()->getDefaultLanguageID();
+               }
                
                self::$languageObj = LanguageFactory::getInstance()->getLanguage($languageID);
                self::getTPL()->setLanguageID(self::getLanguage()->languageID);