Rewrite condition in RequestHandler::buildRequest() to be more clear
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 20 May 2022 13:01:39 +0000 (15:01 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 20 May 2022 13:01:39 +0000 (15:01 +0200)
It now has an explicit “then” (ACP) and “else” (Frontend) part.

wcfsetup/install/files/lib/system/request/RequestHandler.class.php

index c5ae62979c1f1e2234b4ccde48c210970e7a43cb..43e6ae36a99134a5ae5626009d8c5984fa8f0cdf 100644 (file)
@@ -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'])) {