summaryrefslogtreecommitdiff
path: root/includes/WebRequest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-01-24 09:26:41 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-01-24 09:26:41 +0000
commitb6c19d49965caece085e7ee0da9c619b14f19655 (patch)
tree60c57c2a5035d5078fcc417e969f05cc8589f8ab /includes/WebRequest.php
parent3cbab0f9c75400197f64677945b7d8c45de85d06 (diff)
Aktualisierung auf MediaWiki 1.9.1
Diffstat (limited to 'includes/WebRequest.php')
-rw-r--r--includes/WebRequest.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 35336954..7648b75f 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -314,7 +314,20 @@ class WebRequest {
* @return string
*/
function getRequestURL() {
- $base = $_SERVER['REQUEST_URI'];
+ if( isset( $_SERVER['REQUEST_URI'] ) ) {
+ $base = $_SERVER['REQUEST_URI'];
+ } elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) {
+ // Probably IIS; doesn't set REQUEST_URI
+ $base = $_SERVER['SCRIPT_NAME'];
+ if( isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ) {
+ $base .= '?' . $_SERVER['QUERY_STRING'];
+ }
+ } else {
+ // This shouldn't happen!
+ throw new MWException( "Web server doesn't provide either " .
+ "REQUEST_URI or SCRIPT_NAME. Report details of your " .
+ "web server configuration to http://bugzilla.wikimedia.org/" );
+ }
if( $base{0} == '/' ) {
return $base;
} else {