From: Tim Düsterhus Date: Fri, 27 May 2022 14:17:59 +0000 (+0200) Subject: Merge pull request #4830 from WoltLab/landingPage X-Git-Tag: 6.0.0_Alpha_1~1245 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b70bc62933d7ca367c1bb0fa91e29e25b0e15e1;p=GitHub%2FWoltLab%2FWCF.git Merge pull request #4830 from WoltLab/landingPage Remove magic numbers from RoutingCacheBuilder's landingPages data --- 9b70bc62933d7ca367c1bb0fa91e29e25b0e15e1 diff --cc wcfsetup/install/files/lib/system/request/ControllerMap.class.php index ce72cfd50c,4d45643911..9a0097d066 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@@ -249,15 -249,17 +249,15 @@@ class ControllerMap extends SingletonFa * Lookups default controller for given application. * * @param string $application application identifier - * @return null|string[] default controller + * @return string[] default controller * @throws SystemException */ - public function lookupDefaultController($application) + public function lookupDefaultController($application): array { $data = $this->landingPages[$application]; - $controller = $data[1]; + $controller = $data['routePart']; - if ($application === 'wcf' && empty($controller)) { - return null; - } elseif (\preg_match('~^__WCF_CMS__(?P\d+)$~', $controller, $matches)) { + 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