From: Tim Düsterhus Date: Fri, 24 Jul 2015 15:25:07 +0000 (+0200) Subject: Change language in SessionHandler::changeUser(). X-Git-Tag: 3.0.0_Beta_1~2166^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2d90d60f9a676adc84d1957c80df053fa9a8f0e6;p=GitHub%2FWoltLab%2FWCF.git Change language in SessionHandler::changeUser(). --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 63390bf742..7007493502 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -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); } diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 8a00833981..fd0f7828f2 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -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');