From: Tim Düsterhus Date: Wed, 1 Jun 2022 14:40:56 +0000 (+0200) Subject: Remove logic for the clearing of custom URLs for CMS pages from RoutingCacheBuilder X-Git-Tag: 6.0.0_Alpha_1~1218^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1bfaae39040d6b56ed837b5c66aa7931ffaca9b5;p=GitHub%2FWoltLab%2FWCF.git Remove logic for the clearing of custom URLs for CMS pages from RoutingCacheBuilder This is workaround is no longer required or useful since the previous commit, since `ControllerMap::isDefaultController()` will correctly return `true` for those CMS pages, leading to the route builder dropping the controller part in the URL. --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php index 5d8813c9d2..066ea34817 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php @@ -266,11 +266,6 @@ class RoutingCacheBuilder extends AbstractCacheBuilder $rows[] = $row; } - $cmsPageID = 0; - if (\preg_match('~^__WCF_CMS__(\d+)$~', $landingPages['wcf']['controller'], $matches)) { - $cmsPageID = $matches[1]; - } - foreach ($rows as $row) { $customUrl = FileUtil::removeLeadingSlash(FileUtil::removeTrailingSlash($row['controllerCustomURL'])); $packageID = $row['applicationPackageID']; @@ -286,23 +281,7 @@ class RoutingCacheBuilder extends AbstractCacheBuilder $data['reverse'][$abbreviation][$this->classNameToControllerName($row['controller'])] = $customUrl; } else { $cmsIdentifier = '__WCF_CMS__' . $row['pageID'] . '-' . ($row['languageID'] ?: 0); - - // Discard the custom url if this CMS page is the landing page of its associated app. - if ( - !empty($landingPages[$abbreviation]) - && $landingPages[$abbreviation]['controller'] === '__WCF_CMS__' . $row['pageID'] - && !$row['languageID'] - ) { - $customUrl = ''; - } $data['reverse'][$abbreviation][$cmsIdentifier] = $customUrl; - - if ($cmsPageID && $abbreviation === 'wcf') { - if ($customUrl === '' && $cmsPageID != $row['pageID']) { - continue; - } - } - $data['lookup'][$abbreviation][$customUrl] = $cmsIdentifier; } }