Fix the logic of the check for the phrase preload rebuild
authorAlexander Ebert <ebert@woltlab.com>
Mon, 14 Nov 2022 11:50:01 +0000 (12:50 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 14 Nov 2022 11:50:01 +0000 (12:50 +0100)
wcfsetup/install/files/lib/system/language/preload/PhrasePreloader.class.php

index 0789d927f0cb8cc044471902647c1719927e203b..0b62ddb7fa5b3fbe9b1f29e7a9770b65229d8e16 100644 (file)
@@ -24,7 +24,7 @@ final class PhrasePreloader
      */
     public function getUrl(Language $language): string
     {
-        if (!$this->needsRebuild($language)) {
+        if ($this->needsRebuild($language)) {
             $this->rebuild($language);
         }
 
@@ -38,7 +38,7 @@ final class PhrasePreloader
 
     private function needsRebuild(Language $language): bool
     {
-        return \file_exists(\WCF_DIR . $language->getPreloadCacheFilename());
+        return !\file_exists(\WCF_DIR . $language->getPreloadCacheFilename());
     }
 
     private function rebuild(Language $language): void