Remove obsolete code
authorMarcel Werk <burntime@woltlab.com>
Thu, 8 Feb 2024 15:55:57 +0000 (16:55 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 8 Feb 2024 15:55:57 +0000 (16:55 +0100)
The language is already changed in the cronjob handler.

wcfsetup/install/files/lib/system/cronjob/GetUpdateInfoCronjob.class.php

index 55d938e0c70a2453c3bc8c80df62e02a51b2a162..c243cd4a24f83c24a3cd00e1dc6f1aa91436362e 100644 (file)
@@ -27,18 +27,6 @@ class GetUpdateInfoCronjob extends AbstractCronjob
             return;
         }
 
-        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);
-            }
-        }
+        PackageUpdateDispatcher::getInstance()->refreshPackageDatabase([], true);
     }
 }