Applying controller case-sensitive check for aliased controllers
authorAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 15:10:32 +0000 (16:10 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 15:10:32 +0000 (16:10 +0100)
wcfsetup/install/files/lib/system/request/RequestHandler.class.php

index 9129c7c69f840f4f850d2e3ab43ef7ee8e566a06..735f5712e59aca37d8c4037a4fbd837f203e52db 100644 (file)
@@ -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;
                                        }
                                }