From: Alexander Ebert Date: Mon, 13 Feb 2012 16:12:07 +0000 (+0100) Subject: Possible fix for broken route recognition X-Git-Tag: 2.0.0_Beta_1~1350 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf0436f9bbfcb43d1b5be23168da13ab3ca15246;p=GitHub%2FWoltLab%2FWCF.git Possible fix for broken route recognition Fixes #396 --- diff --git a/wcfsetup/install/files/lib/util/UserUtil.class.php b/wcfsetup/install/files/lib/util/UserUtil.class.php index 5882601a6a..bb562d50f9 100644 --- a/wcfsetup/install/files/lib/util/UserUtil.class.php +++ b/wcfsetup/install/files/lib/util/UserUtil.class.php @@ -151,14 +151,19 @@ class UserUtil { public static function getRequestURI() { $REQUEST_URI = ''; + $appendQueryString = true; if (!empty($_SERVER['ORIG_PATH_INFO']) && strpos($_SERVER['ORIG_PATH_INFO'], '.php') !== false) { $REQUEST_URI = $_SERVER['ORIG_PATH_INFO']; } else if (!empty($_SERVER['ORIG_SCRIPT_NAME'])) { $REQUEST_URI = $_SERVER['ORIG_SCRIPT_NAME']; } - else if (!empty($_SERVER['SCRIPT_NAME'])) { - $REQUEST_URI = $_SERVER['SCRIPT_NAME']; + else if (!empty($_SERVER['SCRIPT_NAME']) && (isset($_SERVER['PATH_INFO']) && !empty($_SERVER['PATH_INFO']))) { + $REQUEST_URI = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; + } + else if (isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) { + $REQUEST_URI = $_SERVER['REQUEST_URI']; + $appendQueryString = false; } else if (!empty($_SERVER['PHP_SELF'])) { $REQUEST_URI = $_SERVER['PHP_SELF']; @@ -166,7 +171,7 @@ class UserUtil { else if (!empty($_SERVER['PATH_INFO'])) { $REQUEST_URI = $_SERVER['PATH_INFO']; } - if (!empty($_SERVER['QUERY_STRING'])) { + if ($appendQueryString && !empty($_SERVER['QUERY_STRING'])) { $REQUEST_URI .= '?'.$_SERVER['QUERY_STRING']; }