Only load page content for active languages (#5773)
authorOlaf Braun <olaf_schmitz_1@t-online.de>
Thu, 25 Jan 2024 12:22:24 +0000 (13:22 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2024 12:22:24 +0000 (13:22 +0100)
* Only load page content for active languages

* Typo

---------

Co-authored-by: Alexander Ebert <ebert@woltlab.com>
wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php

index 653f0e0896f06036b5f3a9dab02ee62ddf42c6dd..0942d4874fd9ecdafbd1d1c4daf9fa0a4cd5d3fa 100644 (file)
@@ -9,6 +9,7 @@ use wcf\data\page\Page;
 use wcf\page\AbstractPage;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
+use wcf\system\language\LanguageFactory;
 
 /**
  * Multilingual page sitemap implementation.
@@ -44,6 +45,9 @@ class MultilingualPageSitemapObject extends AbstractSitemapObjectObjectType
             ON          page_content.pageID = page.pageID';
         $pageList->getConditionBuilder()->add('page.isMultilingual = ?', [1]);
         $pageList->getConditionBuilder()->add('page.allowSpidersToIndex = ?', [1]);
+        $pageList->getConditionBuilder()->add('page_content.languageID IN (?)', [
+            \array_keys(LanguageFactory::getInstance()->getLanguages())
+        ]);
 
         return $pageList;
     }