Resolve the application override before generating the link
authorAlexander Ebert <ebert@woltlab.com>
Thu, 20 Jun 2019 14:14:13 +0000 (16:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 20 Jun 2019 14:14:13 +0000 (16:14 +0200)
Fixes #2934

wcfsetup/install/files/lib/system/request/LinkHandler.class.php

index 539b7674981382a2782e4b924830d552ac575241..9cad72fb625e3157ce40e3d4f60c986afea29f5d 100644 (file)
@@ -211,6 +211,7 @@ class LinkHandler extends SingletonFactory {
                }
                
                $parameters['controller'] = $controller;
+               $abbreviation = ControllerMap::getInstance()->getApplicationOverride($abbreviation, $controller);
                $routeURL = RouteHandler::getInstance()->buildRoute($abbreviation, $parameters, $isACP);
                if (!$isRaw && !empty($url)) {
                        $routeURL .= (strpos($routeURL, '?') === false) ? '?' : '&';
@@ -223,8 +224,6 @@ class LinkHandler extends SingletonFactory {
                
                $url = $routeURL . $url;
                
-               $abbreviation = ControllerMap::getInstance()->getApplicationOverride($abbreviation, $controller);
-               
                // handle applications
                if (!PACKAGE_ID) {
                        $url = RouteHandler::getHost() . RouteHandler::getPath(['acp']) . ($isACP ? 'acp/' : '') . $url;