From ee77e6f9f73314578dd7ea2df9df7c9e45607f80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 3 Jun 2022 12:38:01 +0200 Subject: [PATCH] Do not modify state in RequestHandler::buildRequest() --- .../files/lib/system/request/RequestHandler.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 2b38ac05d8..6ef891106d 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -77,8 +77,7 @@ final class RequestHandler extends SingletonFactory $psrRequest = ServerRequestFactory::fromGlobals(); - // build request - $this->buildRequest($application); + $this->activeRequest = $this->buildRequest($application); $pipeline = new Pipeline([ new AddAcpSecurityHeaders(), @@ -108,12 +107,11 @@ final class RequestHandler extends SingletonFactory /** * Builds a new request. * - * @param string $application * @throws IllegalLinkException * @throws NamedUserException * @throws SystemException */ - protected function buildRequest($application) + protected function buildRequest(string $application): Request { try { $routeData = RouteHandler::getInstance()->getRouteData(); @@ -198,7 +196,7 @@ final class RequestHandler extends SingletonFactory } } - $this->activeRequest = new Request( + return new Request( $className, $metaData, !$this->isACPRequest() && ControllerMap::getInstance()->isLandingPage($className, $metaData) -- 2.20.1