From 84651e761d51b1031c046cdbdba3d536e9fb3d05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 23 Jun 2022 17:00:26 +0200 Subject: [PATCH] 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. --- .../files/lib/system/request/RequestHandler.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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'], -- 2.20.1