From: moodler Date: Tue, 6 Jul 2004 12:34:33 +0000 (+0000) Subject: When looking for me() try $_SERVER['URL'] (IIS uses it) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=16c4d82a506306c98aa0fb3ac3c6c33a8205661f;p=moodle.git When looking for me() try $_SERVER['URL'] (IIS uses it) --- diff --git a/lib/weblib.php b/lib/weblib.php index 3c35382a3c..d927fd5925 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -105,8 +105,14 @@ function me() { } return $_SERVER["SCRIPT_NAME"]; + } else if (!empty($_SERVER["URL"])) { // May help IIS (not well tested) + if (!empty($_SERVER["QUERY_STRING"])) { + return $_SERVER["URL"]."?".$_SERVER["QUERY_STRING"]; + } + return $_SERVER["URL"]; + } else { - notify("Warning: Could not find any of these web server variables: \$REQUEST_URI, \$PHP_SELF or \$SCRIPT_NAME"); + notify("Warning: Could not find any of these web server variables: \$REQUEST_URI, \$PHP_SELF, \$SCRIPT_NAME or \$URL"); return false; } }