Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Improved me() function

  • Loading branch information...
commit fced815cd77546b398df16a7116f36e186436367 1 parent db11e52
moodler authored

Showing 1 changed file with 10 additions and 4 deletions. Show diff stats Hide diff stats

  1. +10 4 lib/weblib.php
14 lib/weblib.php
@@ -133,14 +133,20 @@ function me() {
133 133 if (!empty($_SERVER["REQUEST_URI"])) {
134 134 return $_SERVER["REQUEST_URI"];
135 135
136   - } else if (!empty($_SERVER["PATH_INFO"])) {
137   - return $_SERVER["PATH_INFO"];
138   -
139 136 } else if (!empty($_SERVER["PHP_SELF"])) {
  137 + if (!empty($_SERVER["QUERY_STRING"])) {
  138 + return $_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"];
  139 + }
140 140 return $_SERVER["PHP_SELF"];
141 141
  142 + } else if (!empty($_SERVER["SCRIPT_NAME"])) {
  143 + if (!empty($_SERVER["QUERY_STRING"])) {
  144 + return $_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
  145 + }
  146 + return $_SERVER["SCRIPT_NAME"];
  147 +
142 148 } else {
143   - notify("Warning: Could not find any of these web server variables: \$REQUEST_URI, \$PATH_INFO or \$PHP_SELF");
  149 + notify("Warning: Could not find any of these web server variables: \$REQUEST_URI, \$PHP_SELF or \$SCRIPT_NAME");
144 150 }
145 151 }
146 152

0 comments on commit fced815

Please sign in to comment.
Something went wrong with that request. Please try again.