From db4adc87bd656d5a089b30cd512558890a55abd2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 1 Jun 2022 11:28:33 +0200 Subject: [PATCH] Use `str_starts_with()` in ControllerMap::isDefaultController() This replacement is not semantically identical, because the previous version effectively was a `str_contains()`. However the `__WCF_CMS__` marker always appears at the start of the string, making the previous version a bug. --- .../install/files/lib/system/request/ControllerMap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index 36e7e681c0..69b3698eb2 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -324,7 +324,7 @@ class ControllerMap extends SingletonFactory $controller = $matches['controller']; } - if (\strpos($controller, '__WCF_CMS__') !== false) { + if (\str_starts_with($controller, '__WCF_CMS__')) { // remove language id component $controller = \preg_replace('~\-\d+$~', '', $controller); } -- 2.20.1