From: Tim Düsterhus Date: Fri, 20 May 2022 12:38:37 +0000 (+0200) Subject: Do not take `routeData` by reference in RequestHandler::handleDefaultController() X-Git-Tag: 6.0.0_Alpha_1~1259^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=662b3c73f9cffedca8c9c88397313f4aec243a77;p=GitHub%2FWoltLab%2FWCF.git Do not take `routeData` by reference in RequestHandler::handleDefaultController() By returning the updated data the data flow becomes clearer. --- 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; } /**