From 7dbd1d54ac5432922e290d0c16992c104c5cec6a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 1 Jun 2022 11:30:05 +0200 Subject: [PATCH] Remove useless branch in ControllerMap::isDefaultController() The previous change with `str_starts_with()` makes it pretty evident that this condition is redundant with the regular expression above: The regular expression also ensures that the `$controller` starts with `__WCF_CMS__` and at the end of that branch the `$controller` will always be stripped of the language ID suffix. --- .../install/files/lib/system/request/ControllerMap.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index 69b3698eb2..119b6ae0c3 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -323,11 +323,6 @@ class ControllerMap extends SingletonFactory $controller = $matches['controller']; } - - if (\str_starts_with($controller, '__WCF_CMS__')) { - // remove language id component - $controller = \preg_replace('~\-\d+$~', '', $controller); - } } if ($this->landingPages[$application]['controller'] === $controller) { -- 2.20.1