From: Tim Düsterhus Date: Thu, 23 Jun 2022 15:00:26 +0000 (+0200) Subject: Stop adding the `isDefaultController` value to `$routeData` in RequestHandler X-Git-Tag: 6.0.0_Alpha_1~1151^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=84651e761d51b1031c046cdbdba3d536e9fb3d05;p=GitHub%2FWoltLab%2FWCF.git Stop adding the `isDefaultController` value to `$routeData` in RequestHandler The `$routeData` array is only processed locally, except when it is passed to LinkHandler for renamed controllers (which can't happen for default controllers), thus this is completely redundant with simply checking `->isDefaultController()` in the other places, with the latter being much more clear, because one does not need to think about where the `$routeData` might end up. --- diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 8250deb25b..4398557943 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -140,8 +140,6 @@ final class RequestHandler extends SingletonFactory foreach ($data as $key => $value) { $routeData[$key] = $value; } - - $routeData['isDefaultController'] = true; } } @@ -165,7 +163,7 @@ final class RequestHandler extends SingletonFactory $classApplication = $application; if ( - !empty($routeData['isDefaultController']) + RouteHandler::getInstance()->isDefaultController() && !empty($routeData['application']) && $routeData['application'] !== $application ) { @@ -199,7 +197,9 @@ final class RequestHandler extends SingletonFactory } // handle CMS page meta data - $metaData = ['isDefaultController' => (!empty($routeData['isDefaultController']))]; + $metaData = [ + 'isDefaultController' => RouteHandler::getInstance()->isDefaultController() + ]; if (isset($routeData['cmsPageID'])) { $metaData['cms'] = [ 'pageID' => $routeData['cmsPageID'],