From 662b3c73f9cffedca8c9c88397313f4aec243a77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 20 May 2022 14:38:37 +0200 Subject: [PATCH] Do not take `routeData` by reference in RequestHandler::handleDefaultController() By returning the updated data the data flow becomes clearer. --- .../files/lib/system/request/RequestHandler.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 109f982465..56a999f10a 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -124,7 +124,7 @@ final class RequestHandler extends SingletonFactory // handle landing page for frontend requests if (!$this->isACPRequest()) { - $this->handleDefaultController($application, $routeData); + $routeData = $this->handleDefaultController($application, $routeData); // check if accessing from the wrong domain (e.g. "www." omitted but domain was configured with) $domainName = ApplicationHandler::getInstance()->getDomainName(); @@ -267,10 +267,10 @@ final class RequestHandler extends SingletonFactory * @param string[] $routeData * @throws IllegalLinkException */ - protected function handleDefaultController($application, array &$routeData) + protected function handleDefaultController(string $application, array $routeData): array { if (!RouteHandler::getInstance()->isDefaultController()) { - return; + return $routeData; } $data = ControllerMap::getInstance()->lookupDefaultController($application); @@ -308,6 +308,8 @@ final class RequestHandler extends SingletonFactory } $routeData['isDefaultController'] = true; + + return $routeData; } /** -- 2.20.1