Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved me() function

  • Loading branch information...
commit fced815cd77546b398df16a7116f36e186436367 1 parent db11e52
moodler authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/weblib.php
14 lib/weblib.php
View
@@ -133,14 +133,20 @@ function me() {
if (!empty($_SERVER["REQUEST_URI"])) {
return $_SERVER["REQUEST_URI"];
- } else if (!empty($_SERVER["PATH_INFO"])) {
- return $_SERVER["PATH_INFO"];
-
} else if (!empty($_SERVER["PHP_SELF"])) {
+ if (!empty($_SERVER["QUERY_STRING"])) {
+ return $_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"];
+ }
return $_SERVER["PHP_SELF"];
+ } else if (!empty($_SERVER["SCRIPT_NAME"])) {
+ if (!empty($_SERVER["QUERY_STRING"])) {
+ return $_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
+ }
+ return $_SERVER["SCRIPT_NAME"];
+
} else {
- notify("Warning: Could not find any of these web server variables: \$REQUEST_URI, \$PATH_INFO or \$PHP_SELF");
+ notify("Warning: Could not find any of these web server variables: \$REQUEST_URI, \$PHP_SELF or \$SCRIPT_NAME");
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.