Clean up `$classData` in RequestHandler::buildRequest()
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 20 May 2022 12:51:31 +0000 (14:51 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 20 May 2022 12:58:47 +0000 (14:58 +0200)
Since the recent changes only the `className` member of this array was access.
Simplify this to a simple `$className` variable.

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

index bdded4e2139d8fed4b2bc8b7a08d75bf049219f0..c5ae62979c1f1e2234b4ccde48c210970e7a43cb 100644 (file)
@@ -148,10 +148,7 @@ final class RequestHandler extends SingletonFactory
             }
 
             if (isset($routeData['className'])) {
-                $classData = [
-                    'className' => $routeData['className'],
-                    'controller' => $routeData['controller'],
-                ];
+                $className = $routeData['className'];
             } else {
                 $controller = $routeData['controller'];
 
@@ -186,6 +183,8 @@ final class RequestHandler extends SingletonFactory
                 );
                 if (\is_string($classData)) {
                     $this->redirect($routeData, $application, $classData);
+                } else {
+                    $className = $classData['className'];
                 }
             }
 
@@ -206,13 +205,13 @@ final class RequestHandler extends SingletonFactory
             }
 
             $this->activeRequest = new Request(
-                $classData['className'],
+                $className,
                 $metaData
             );
 
             if (!$this->isACPRequest()) {
                 // determine if current request matches the landing page
-                if (ControllerMap::getInstance()->isLandingPage($classData['className'], $metaData)) {
+                if (ControllerMap::getInstance()->isLandingPage($className, $metaData)) {
                     $this->activeRequest->setIsLandingPage();
                 }
             }