/**
* Handles http requests.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
/**
* Handles a http request.
- *
+ *
* @param string $application
* @param boolean $isACPRequest
*/
/**
* Builds a new request.
- *
+ *
* @param string $application
*/
protected function buildRequest($application) {
$routeData['controller'] = $landingPage->getController();
}
else {
- // check if current URL matches an application but controller was omitted
+ // check if request URI resolves to an application different from relative route
+ // important: request URI may not contain anything else expect for the path
$currentRequestURI = RouteHandler::getHost() . $requestUri;
+ $redirectToLandingPage = false;
+ if ($currentRequestURI == ApplicationHandler::getInstance()->getPrimaryApplication()->getPageURL()) {
+ HeaderUtil::redirect($landingPage->getLink(), true);
+ exit;
+ }
+
+ // check if current URL matches an application but controller was omitted
foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
if ($currentRequestURI == $application->getPageURL()) {
if ($controller = WCF::getApplicationObject($application)->getPrimaryController()) {
exit;
}
}
-
}
-
- // redirect to landing page
- HeaderUtil::redirect($landingPage->getLink(), true);
- exit;
}
}
/**
* Returns the class data for the active request or null if for the given
* configuration no proper class exist.
- *
+ *
* @param string $controller
* @param string $pageType
* @param string $application
/**
* Returns the active request object.
- *
+ *
* @return \wcf\system\request\Request
*/
public function getActiveRequest() {
/**
* Returns true if the request is an acp request.
- *
+ *
* @return boolean
*/
public function isACPRequest() {
/**
* Returns true, if current host mismatches any known domain.
- *
+ *
* @return boolean
*/
public function inRescueMode() {