From: Tim Düsterhus Date: Fri, 20 May 2022 12:46:47 +0000 (+0200) Subject: Make ControllerMap::isLandingPage() take a className, not a classData array X-Git-Tag: 6.0.0_Alpha_1~1259^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c16a2686171f624fff01fc861d0ab8db8d11abf0;p=GitHub%2FWoltLab%2FWCF.git Make ControllerMap::isLandingPage() take a className, not a classData array It is only interested in the className field of the given array and taking a className directly makes the API clearer. --- diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index ca63a1b467..29914b761f 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -354,17 +354,16 @@ class ControllerMap extends SingletonFactory /** * Returns true if currently active request represents the landing page. * - * @param string[] $classData * @param array $metaData * @return bool */ - public function isLandingPage(array $classData, array $metaData) + public function isLandingPage(string $className, array $metaData) { - if ($classData['className'] !== $this->landingPages['wcf'][2]) { + if ($className !== $this->landingPages['wcf'][2]) { return false; } - if ($classData['className'] === CmsPage::class) { + if ($className === CmsPage::class) { // check if page id matches if ($this->landingPages['wcf'][1] !== '__WCF_CMS__' . $metaData['cms']['pageID']) { return false; diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index d8f20d340b..bdded4e213 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -212,7 +212,7 @@ final class RequestHandler extends SingletonFactory if (!$this->isACPRequest()) { // determine if current request matches the landing page - if (ControllerMap::getInstance()->isLandingPage($classData, $metaData)) { + if (ControllerMap::getInstance()->isLandingPage($classData['className'], $metaData)) { $this->activeRequest->setIsLandingPage(); } }