From: Alexander Ebert Date: Mon, 8 Jun 2015 08:54:07 +0000 (+0200) Subject: Fixed redirect to landing page triggered on non-primary application X-Git-Tag: 2.1.5~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3eb25f5bad21c1765d2a710b11dd74e6fc5416aa;p=GitHub%2FWoltLab%2FWCF.git Fixed redirect to landing page triggered on non-primary application --- diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index dbd4fb3996..a596ce798d 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -291,9 +291,10 @@ class RequestHandler extends SingletonFactory { // resolve implicit application abbreviation for landing page controller $landingPageApplication = $landingPage->getApplication(); + $primaryApplication = ApplicationHandler::getInstance()->getPrimaryApplication(); + $primaryApplicationAbbr = ApplicationHandler::getInstance()->getAbbreviation($primaryApplication->packageID); if ($landingPageApplication == 'wcf') { - $primaryApplication = ApplicationHandler::getInstance()->getPrimaryApplication(); - $landingPageApplication = ApplicationHandler::getInstance()->getAbbreviation($primaryApplication->packageID); + $landingPageApplication = $primaryApplicationAbbr; } // check if currently invoked application matches the landing page @@ -303,8 +304,16 @@ class RequestHandler extends SingletonFactory { return; } - HeaderUtil::redirect($landingPage->getLink()); - exit; + // redirect if this is the primary application + if ($application === $primaryApplicationAbbr) { + HeaderUtil::redirect($landingPage->getLink()); + exit; + } + + // set default controller + $applicationObj = WCF::getApplicationObject(ApplicationHandler::getInstance()->getApplication($application)); + $routeData['controller'] = preg_replace('~^.*?\\\([^\\\]+)(?:Action|Form|Page)$~', '\\1', $applicationObj->getPrimaryController()); + if (!URL_LEGACY_MODE) $routeData['controller'] = self::getTokenizedController($routeData['controller']); } /**