Change language in SessionHandler::changeUser().
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 24 Jul 2015 15:25:07 +0000 (17:25 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 24 Jul 2015 15:25:07 +0000 (17:25 +0200)
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index 63390bf742e6c7353e0163e3c70e5ebca2190ee9..70074935029a707a132addbb7608a8524d1225d1 100644 (file)
@@ -585,6 +585,8 @@ class WCF {
         * @param       integer         $languageID
         */
        public static final function setLanguage($languageID) {
+               if (!$languageID) $languageID = LanguageFactory::getInstance()->getDefaultLanguageID();
+               
                self::$languageObj = LanguageFactory::getInstance()->getLanguage($languageID);
                self::getTPL()->setLanguageID(self::getLanguage()->languageID);
        }
index 8a00833981d55ca64085c03a1dcb4cfdb82d9b4e..fd0f7828f23bcd3caef586dec6e3d611d03e3fa0 100644 (file)
@@ -737,6 +737,9 @@ class SessionHandler extends SingletonFactory {
                $this->languageID = $this->user->languageID;
                $this->styleID = $this->user->styleID;
                
+               // change language
+               WCF::setLanguage($this->languageID ?: 0);
+               
                // in some cases the language id can be stuck in the session variables
                $this->unregister('languageID');