From: Tim Düsterhus Date: Thu, 23 Jun 2022 13:12:24 +0000 (+0200) Subject: Remove fallback to 'wcf' in LookupRequestRoute X-Git-Tag: 6.0.0_Alpha_1~1145^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0b1cfaa23ba637c2e52c867c7eff14519075a056;p=GitHub%2FWoltLab%2FWCF.git Remove fallback to 'wcf' in LookupRequestRoute This fallback exists since c2de61fb187cf357cd9653693a8fa7cad39ca6ef which is the first commit which made custom URLs actually functional. The purpose of this fallback is unclear, it might be related to 'wcf' not having its own frontend before WoltLab Suite 3.0 and logic expecting that wcf controllers are accessible from any app. What's certain is, that this fallback is pretty intransparent, because it: 1) Only affects custom URLs. 2) Only affects controllers assigned to the 'wcf' app. 3) Only affects controllers where the accessed application does not have the same customURL in its inventory. Consider this example: - 'wcf', 'wbb' and 'blog' are installed. - wcf's AccountManagement is renamed to `my-controller` - wbb's WatchedThreadList is also renamed to `my-controller` - blog is left as is Now accessing: - `/index.php?my-controller` goes to AccountManagement - `/blog/index.php?my-controller` goes to AccountManagement - `/forum/index.php?my-controller` goes to … WatchedThreadList which most certainly violates the user's expectations. See also 4da8c1de463ca71f09d284f3529c1d499a7ac8f8 which adjusts a very similar feature. --- diff --git a/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php b/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php index 2a1bf0e1ea..f9d77a6c01 100644 --- a/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php @@ -58,14 +58,6 @@ class LookupRequestRoute implements IRequestRoute FileUtil::removeTrailingSlash($matches['controller']) ); - // lookup WCF controllers unless initial request targeted WCF itself - if ($this->routeData === [] && $application !== 'wcf') { - $this->routeData = ControllerMap::getInstance()->resolveCustomController( - 'wcf', - FileUtil::removeTrailingSlash($matches['controller']) - ); - } - if ($this->routeData !== []) { if (!empty($matches['id'])) { $this->routeData['id'] = $matches['id']; @@ -83,14 +75,6 @@ class LookupRequestRoute implements IRequestRoute $application, FileUtil::removeTrailingSlash($requestURL) ); - - // lookup WCF controllers unless initial request targeted WCF itself - if ($this->routeData === [] && $application !== 'wcf') { - $this->routeData = ControllerMap::getInstance()->resolveCustomController( - 'wcf', - FileUtil::removeTrailingSlash($requestURL) - ); - } } }