diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-12-10 20:13:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-12-10 20:13:36 +0000 |
commit | a98fa4c2c883637939b8eb2510eb4706adac335f (patch) | |
tree | d4b6be75ba30c7fa49c632c73b223871c9a75d7b | |
parent | b86f45b1e688d2b7c6d092b007ece39995f82c3e (diff) | |
download | brdo-a98fa4c2c883637939b8eb2510eb4706adac335f.tar.gz brdo-a98fa4c2c883637939b8eb2510eb4706adac335f.tar.bz2 |
- Patch #102232 by webernet: roll-back of #87310.
-rw-r--r-- | includes/bootstrap.inc | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index b22b8b561..83979afd9 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -549,30 +549,20 @@ function check_plain($text) { } /** - * The value of $_SERVER['REQUEST_URI'] is inconsistent between various - * web servers (Apache, IIS, iPlanet, etc.). - * - * For those cases where REQUEST_URI is provided, we inspect it to be sure - * that it contains the QUERY_STRING as well as the actual REQUEST_URI. - * - * Where this value is not available we generate an equivalent using other - * environment variables. + * Since $_SERVER['REQUEST_URI'] is only available on Apache, we + * generate an equivalent using other environment variables. */ function request_uri() { - static $uri; - if (!isset($uri)) { - // If we have a REQUEST_URI and the query string is present in it, we use the value directly. - if (isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['QUERY_STRING']) && strpos($_SERVER['REQUEST_URI'], $_SERVER['QUERY_STRING'])) { - $uri = $_SERVER['REQUEST_URI']; + + if (isset($_SERVER['REQUEST_URI'])) { + $uri = $_SERVER['REQUEST_URI']; + } + else { + if (isset($_SERVER['argv'])) { + $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0]; } else { - // Generate an equivalent. - if (isset($_SERVER['argv'])) { - $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0]; - } - else { - $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING']; - } + $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING']; } } |