From bfb1b4d84564bf581c1030f80e75390dadf5e6f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 2 Jun 2022 11:24:58 +0200 Subject: [PATCH] Remove dead branch in ControllerMap::lookupDefaultController() It was impossible to take this branch since d10487d5b8f54ce86fa8d8f36649febd338dbae8, because since this commit i18n CMS pages (which this branch was about) were unable to have an empty custom URL. Since 1bfaae39040d6b56ed837b5c66aa7931ffaca9b5 it is entirely impossible for any empty custom URLs to exist, making this branch completely dead. Further it only ever supported the WCF landing page, not any application's landing pages. The original intent of this branch will be restored in a follow up commit. --- .../system/request/ControllerMap.class.php | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index e484385a05..e98993558c 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -240,29 +240,9 @@ class ControllerMap extends SingletonFactory if (\preg_match('~^__WCF_CMS__(?P\d+)$~', $controller, $matches)) { $cmsPageData = $this->lookupCmsPage($matches['pageID'], 0); if ($cmsPageData === null) { - // page is multilingual, use the language id that matches the URL - // do *not* use the client language id, Google's bot is stubborn + // page is multilingual - $languageID = null; - // use a reverse search to find the page - if ( - isset($this->customUrls['lookup']['wcf']) - && isset($this->customUrls['lookup']['wcf']['']) - && \preg_match( - '~^__WCF_CMS__\d+\-(?P\d+)$~', - $this->customUrls['lookup']['wcf'][''], - $match - ) - ) { - $languageID = $match['languageID']; - } - - if ($languageID === null) { - // something went wrong, use the current language id - $languageID = WCF::getLanguage()->languageID; - } - - $cmsPageData = $this->lookupCmsPage($matches['pageID'], $languageID); + $cmsPageData = $this->lookupCmsPage($matches['pageID'], WCF::getLanguage()->languageID); if ($cmsPageData === null) { throw new SystemException("Unable to resolve CMS page"); } -- 2.20.1