From: Tim Düsterhus Date: Thu, 6 Apr 2023 11:47:15 +0000 (+0200) Subject: Revert "Inline DynamicRequestRoute::getControllerName()" X-Git-Tag: 6.0.0_Alpha_1~285^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7cd7be5225a0427d1b5bd105c6e34bd349e4e97e;p=GitHub%2FWoltLab%2FWCF.git 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. --- 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()); + } }