Check the landing page against PageCache::getLandingPage() in PageLocationManager
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 1 Jun 2022 12:02:03 +0000 (14:02 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 1 Jun 2022 12:06:50 +0000 (14:06 +0200)
The landing page returned by `PageCache` is the landing page as used everywhere
else. Use that one instead of checking the property for consistency.

wcfsetup/install/files/lib/system/page/PageLocationManager.class.php

index 24ff00c126842131ecee7f54ece52543ead2cbbc..aced2cd366cc7a403e6a2086558d5450cf31134e 100644 (file)
@@ -108,7 +108,8 @@ class PageLocationManager extends SingletonFactory
             $title = $page->getTitle();
         }
 
-        if ($page->isLandingPage && BREADCRUMBS_HOME_USE_PAGE_TITLE) {
+        $landingPage = PageCache::getInstance()->getLandingPage();
+        if ($page->pageID == $landingPage->pageID && BREADCRUMBS_HOME_USE_PAGE_TITLE) {
             $title = WCF::getLanguage()->get(PAGE_TITLE);
         }
 
@@ -148,13 +149,14 @@ class PageLocationManager extends SingletonFactory
 
             if ($location['pageID']) {
                 $page = PageCache::getInstance()->getPage($location['pageID']);
+                $landingPage = PageCache::getInstance()->getLandingPage();
                 while ($page !== null && $page->parentPageID) {
                     $page = PageCache::getInstance()->getPage($page->parentPageID);
                     if (!$page->isVisible()) {
                         continue;
                     }
 
-                    if ($page->isLandingPage && BREADCRUMBS_HOME_USE_PAGE_TITLE) {
+                    if ($page->pageID == $landingPage->pageID && BREADCRUMBS_HOME_USE_PAGE_TITLE) {
                         $title = WCF::getLanguage()->get(PAGE_TITLE);
                     } else {
                         $title = $page->getTitle();