From: Alexander Ebert Date: Tue, 3 Mar 2015 15:10:32 +0000 (+0100) Subject: Applying controller case-sensitive check for aliased controllers X-Git-Tag: 2.1.1~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a000a582fca7d8b41b8d82d8fe62ac7020ca45a4;p=GitHub%2FWoltLab%2FWCF.git Applying controller case-sensitive check for aliased controllers --- diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 9129c7c69f..735f5712e5 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -179,14 +179,23 @@ class RequestHandler extends SingletonFactory { // handle controller aliasing if (!URL_LEGACY_MODE && isset($routeData['controller'])) { + $ciController = mb_strtolower($routeData['controller']); + // aliased controller, redirect to new URL - $alias = $this->getAliasByController($routeData['controller']); + $alias = $this->getAliasByController($ciController); if ($alias !== null) { $this->redirect($routeData, $application); } - $controller = $this->getControllerByAlias($routeData['controller']); + $controller = $this->getControllerByAlias($ciController); if ($controller !== null) { + // check if controller was provided explicitly as it should + $alias = $this->getAliasByController($controller); + if ($alias != $routeData['controller']) { + $routeData['controller'] = $controller; + $this->redirect($routeData, $application); + } + $routeData['controller'] = $controller; } }