From: Tim Düsterhus Date: Fri, 3 Jun 2022 10:30:11 +0000 (+0200) Subject: Make \wcf\system\request\Request externally immutable X-Git-Tag: 6.0.0_Alpha_1~1202^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=085cda6dc739f373d42016464732512f77c80147;p=GitHub%2FWoltLab%2FWCF.git Make \wcf\system\request\Request externally immutable --- diff --git a/wcfsetup/install/files/lib/system/request/Request.class.php b/wcfsetup/install/files/lib/system/request/Request.class.php index 772d2986b0..3f362cbce0 100644 --- a/wcfsetup/install/files/lib/system/request/Request.class.php +++ b/wcfsetup/install/files/lib/system/request/Request.class.php @@ -53,18 +53,11 @@ final class Request implements RequestHandlerInterface * @param string $className fully qualified name * @param string[] $metaData additional meta data */ - public function __construct($className, array $metaData) + public function __construct($className, array $metaData, bool $isLandingPage) { $this->className = $className; $this->metaData = $metaData; - } - - /** - * Marks this request as landing page. - */ - public function setIsLandingPage() - { - $this->isLandingPage = true; + $this->isLandingPage = $isLandingPage; } /** diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 87d223da77..2b38ac05d8 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -200,15 +200,9 @@ final class RequestHandler extends SingletonFactory $this->activeRequest = new Request( $className, - $metaData + $metaData, + !$this->isACPRequest() && ControllerMap::getInstance()->isLandingPage($className, $metaData) ); - - if (!$this->isACPRequest()) { - // determine if current request matches the landing page - if (ControllerMap::getInstance()->isLandingPage($className, $metaData)) { - $this->activeRequest->setIsLandingPage(); - } - } } catch (SystemException $e) { if ( \defined('ENABLE_DEBUG_MODE')