From: Alexander Ebert Date: Sat, 1 Jun 2013 12:50:48 +0000 (+0200) Subject: Added fix for certain webspace environments (e.g. 1&1) X-Git-Tag: 2.0.0_Beta_3~69 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4e39ccf18e24076aba60091eb309ac025439666;p=GitHub%2FWoltLab%2FWCF.git Added fix for certain webspace environments (e.g. 1&1) --- diff --git a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php index c2f78ee96a..176b0e3ea3 100644 --- a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php @@ -105,7 +105,29 @@ class RouteHandler extends SingletonFactory { * @return boolean */ public function matches() { - $pathInfo = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : ''; + $pathInfo = ''; + if (isset($_SERVER['ORIG_PATH_INFO'])) { + $pathInfo = $_SERVER['ORIG_PATH_INFO']; + + // in some configurations ORIG_PATH_INFO contains the path to the file + // if the intended PATH_INFO component is empty + if (!empty($pathInfo)) { + if (isset($_SERVER['SCRIPT_NAME']) && ($pathInfo == $_SERVER['SCRIPT_NAME'])) { + $pathInfo = ''; + } + + if (isset($_SERVER['PHP_SELF']) && ($pathInfo == $_SERVER['PHP_SELF'])) { + $pathInfo = ''; + } + + if (isset($_SERVER['SCRIPT_URL']) && ($pathInfo == $_SERVER['SCRIPT_URL'])) { + $pathInfo = ''; + } + } + } + else if (isset($_SERVER['PATH_INFO'])) { + $pathInfo = $_SERVER['PATH_INFO']; + } foreach ($this->routes as $route) { if (RequestHandler::getInstance()->isACPRequest() != $route->isACP()) {