From: Marcel Werk Date: Tue, 30 Mar 2021 13:24:21 +0000 (+0200) Subject: Always fetch package information using the default language X-Git-Tag: 5.3.6~33 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d07b90bbc141bd4ce9786ad951806e87f81d1fc;p=GitHub%2FWoltLab%2FWCF.git Always fetch package information using the default language --- diff --git a/wcfsetup/install/files/lib/system/cronjob/GetUpdateInfoCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/GetUpdateInfoCronjob.class.php index 589d9db380..379052d6a2 100644 --- a/wcfsetup/install/files/lib/system/cronjob/GetUpdateInfoCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/GetUpdateInfoCronjob.class.php @@ -1,7 +1,9 @@ refreshPackageDatabase([], true); + try { + $currentLanguage = WCF::getLanguage(); + // Always fetch package information using the default language. + if ($currentLanguage->languageID !== LanguageFactory::getInstance()->getDefaultLanguage()->languageID) { + WCF::setLanguage(LanguageFactory::getInstance()->getDefaultLanguage()); + } + + PackageUpdateDispatcher::getInstance()->refreshPackageDatabase([], true); + } + finally { + if ($currentLanguage->languageID !== LanguageFactory::getInstance()->getDefaultLanguage()->languageID) { + WCF::setLanguage($currentLanguage); + } + } } } }