From 151df198ffc95c0a236cafa9e8ef7ee0fb581005 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 29 Sep 2016 17:11:55 +0200 Subject: [PATCH] Fixed landing page belonging to different application --- .../files/lib/system/request/ControllerMap.class.php | 5 +++-- .../files/lib/system/request/RequestHandler.class.php | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index 214b66aa8b..e624436183 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -195,7 +195,8 @@ class ControllerMap extends SingletonFactory { * @throws SystemException */ public function lookupDefaultController($application) { - $controller = $this->landingPages[$application][1]; + $data = $this->landingPages[$application]; + $controller = $data[1]; if ($application === 'wcf' && empty($controller)) { return null; @@ -221,7 +222,7 @@ class ControllerMap extends SingletonFactory { } return [ - 'application' => $application, + 'application' => mb_substr($data[2], 0, mb_strpos($data[2], '\\')), 'controller' => $controller ]; } diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index cbf49e1561..edd64432ef 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -222,6 +222,15 @@ class RequestHandler extends SingletonFactory { // force a redirect HeaderUtil::redirect($data['redirect'], true, false); } + else if ($data['application'] !== $application) { + HeaderUtil::redirect( + LinkHandler::getInstance()->getLink( + ControllerMap::getInstance()->resolve($data['application'], $data['controller'], false)['controller'], + ['application' => $data['application']] + ) + ); + exit; + } // copy route data foreach ($data as $key => $value) { -- 2.20.1