From 7cd7be5225a0427d1b5bd105c6e34bd349e4e97e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 6 Apr 2023 13:47:15 +0200 Subject: [PATCH] Revert "Inline DynamicRequestRoute::getControllerName()" 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. --- .../route/DynamicRequestRoute.class.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php b/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php index c6039bf917..e6777de47f 100644 --- a/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php @@ -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()); + } } -- 2.20.1