From 624d42f1f6886fc22bb9967a9af611b7fb819b27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 20 May 2022 15:01:39 +0200 Subject: [PATCH] Rewrite condition in RequestHandler::buildRequest() to be more clear MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It now has an explicit “then” (ACP) and “else” (Frontend) part. --- .../files/lib/system/request/RequestHandler.class.php | 10 ++++++---- 1 file changed, 6 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 c5ae62979c..43e6ae36a9 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -122,8 +122,12 @@ final class RequestHandler extends SingletonFactory try { $routeData = RouteHandler::getInstance()->getRouteData(); - // handle landing page for frontend requests - if (!$this->isACPRequest()) { + if ($this->isACPRequest()) { + if (empty($routeData['controller'])) { + $routeData['controller'] = 'index'; + } + } else { + // handle landing page for frontend requests $routeData = $this->handleDefaultController($application, $routeData); // check if accessing from the wrong domain (e.g. "www." omitted but domain was configured with) @@ -143,8 +147,6 @@ final class RequestHandler extends SingletonFactory exit; } - } elseif (empty($routeData['controller'])) { - $routeData['controller'] = 'index'; } if (isset($routeData['className'])) { -- 2.20.1