Fixed issues when routes to ACP and frontend are generated on the same page
authorAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 14:17:00 +0000 (15:17 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 14:17:00 +0000 (15:17 +0100)
wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php

index 2ee79a42e54dcd8605f64c053f21be189b686296..16840d4af2930a0519658b9ee69cf69d3226d83c 100644 (file)
@@ -23,6 +23,12 @@ class FlexibleRoute implements IRoute {
         */
        protected $buildSchema = array();
        
+       /**
+        * cached list of transformed controller names
+        * @var array<string>
+        */
+       protected $controllerNames = array();
+       
        /**
         * route is restricted to ACP
         * @var boolean
@@ -47,12 +53,6 @@ class FlexibleRoute implements IRoute {
         */
        protected $routeData = array();
        
-       /**
-        * cached list of transformed controller names
-        * @var array<string>
-        */
-       protected static $controllerNames = array();
-       
        /**
         * Creates a new flexible route instace.
         * 
@@ -278,13 +278,13 @@ class FlexibleRoute implements IRoute {
         * @return      string
         */
        protected function getControllerName($application, $controller) {
-               if (!isset(self::$controllerNames[$controller])) {
+               if (!isset($this->controllerNames[$controller])) {
                        $controllerName = RequestHandler::getTokenizedController($controller);
                        $alias = (!$this->isACP) ? RequestHandler::getInstance()->getAliasByController($controllerName) : null;
                        
-                       self::$controllerNames[$controller] = ($alias) ?: $controllerName;
+                       $this->controllerNames[$controller] = ($alias) ?: $controllerName;
                }
                
-               return self::$controllerNames[$controller];
+               return $this->controllerNames[$controller];
        }
 }