From bef107beccc4ecb7d69f8afea932213af35978c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 1 Jun 2022 14:02:03 +0200 Subject: [PATCH] Check the landing page against PageCache::getLandingPage() in PageLocationManager The landing page returned by `PageCache` is the landing page as used everywhere else. Use that one instead of checking the property for consistency. --- .../files/lib/system/page/PageLocationManager.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/page/PageLocationManager.class.php b/wcfsetup/install/files/lib/system/page/PageLocationManager.class.php index 24ff00c126..aced2cd366 100644 --- a/wcfsetup/install/files/lib/system/page/PageLocationManager.class.php +++ b/wcfsetup/install/files/lib/system/page/PageLocationManager.class.php @@ -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(); -- 2.20.1