IIS compatibility problem with REQUEST_URI

IIS compatibility problem with REQUEST_URI

by Petr Skoda -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I have seen some notices "Undefined index: REQUEST_URI" on my IIS test server when using latest 1.5dev. The problem is in get_performance_info () from moodlelib.php, some more info is here - Apache and IIS PHP $_SERVER Superglobal Comparision.

IMO we should use only server features that are available on both IIS and Apache. We could also update the coding guide...

Maybe we could add something like this to setup.php:

if (!isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME'])) {
  if (isset($_SERVER['QUERY_STRING'])) {
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
  } else {
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
  }
}

Hmm, the QUERY_STRING is not listed as supported in the page above, but it works for me :-\  Does anybody have any better list of supported tags?

skodak

---
or get_performance_info() could simply use me() from weblib.php...
Average of ratings: -
In reply to Petr Skoda

Re: IIS compatibility problem with REQUEST_URI

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Definitely me() wink

I've fixed this in log view (and removed it completely from web view, as it was annoying me to be constantly told what page I was looking at smile )