Route cache did not distinguish between ACP and frontend destinations
authorAlexander Ebert <ebert@woltlab.com>
Sat, 17 Feb 2018 13:19:05 +0000 (14:19 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 17 Feb 2018 13:19:05 +0000 (14:19 +0100)
wcfsetup/install/files/lib/system/request/ControllerMap.class.php

index 2ba8fa195aeaa508040848bd8c195310492a6aea..b72ad31f940f61f942db3317b2f82a97a2701f36 100644 (file)
@@ -160,16 +160,16 @@ class ControllerMap extends SingletonFactory {
         * @return      string          url representation of controller, e.g. 'members-list'
         */
        public function lookup($application, $controller, $forceFrontend = null) {
-               $lookupKey = $application . '-' . $controller;
+               if ($forceFrontend === null) {
+                       $forceFrontend = !class_exists(WCFACP::class, false);
+               }
+               
+               $lookupKey = ($forceFrontend ? '' : 'acp-') . $application . '-' . $controller;
                
                if (isset($this->lookupCache[$lookupKey])) {
                        return $this->lookupCache[$lookupKey];
                }
                
-               if ($forceFrontend === null) {
-                       $forceFrontend = !class_exists(WCFACP::class, false);
-               }
-               
                if ($forceFrontend && isset($this->customUrls['reverse'][$application]) && isset($this->customUrls['reverse'][$application][$controller])) {
                        $urlController = $this->customUrls['reverse'][$application][$controller];
                }