Revert "Inline DynamicRequestRoute::getControllerName()"
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 6 Apr 2023 11:47:15 +0000 (13:47 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 6 Apr 2023 11:47:15 +0000 (13:47 +0200)
The inlining of the method resulted in an unintentional and silent breaking
change for classes that register custom routes that, due to the missing
`final`, derive from DynamicRequestRoute and overwrite the method with a custom
implementation.

This reverts commit f9a440759dcf65edd108046b53babde404853ee8.

wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php

index c6039bf91784b7a7edf32ef7e85c1b57d632d455..e6777de47f8ac713fd50c47422d6634f0c746e22 100644 (file)
@@ -207,11 +207,7 @@ class DynamicRequestRoute implements IRequestRoute
 
                     // handle controller names
                     if ($value === 'controller') {
-                        $components[$value] = ControllerMap::getInstance()->lookup(
-                            $application,
-                            $components[$value],
-                            !$this->isACP()
-                        );
+                        $components[$value] = $this->getControllerName($application, $components[$value]);
                     }
 
                     $link .= $components[$value];
@@ -297,4 +293,16 @@ class DynamicRequestRoute implements IRequestRoute
 
         return false;
     }
+
+    /**
+     * Returns the transformed controller name.
+     *
+     * @param string $application
+     * @param string $controller
+     * @return  string
+     */
+    protected function getControllerName($application, $controller)
+    {
+        return ControllerMap::getInstance()->lookup($application, $controller, !$this->isACP());
+    }
 }