]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/RawPage.php
MediaWiki 1.15.0
[autoinstallsdev/mediawiki.git] / includes / RawPage.php
index 7093367ff030fade80016221b2923be40208edb2..b422d49ee3c9c961f6e38826504aa6eace1a5bb3 100644 (file)
@@ -127,6 +127,15 @@ class RawPage {
                        $url = $_SERVER['PHP_SELF'];
                }
 
+               if( $url == '' ) {
+                       # This will make the next check fail with a confusing error
+                       # message, so we should mention it separately.
+                       wfHttpError( 500, 'Internal Server Error',
+                               "\$_SERVER['PHP_SELF'] is not set.  Perhaps you're using CGI" .
+                               " and haven't set cgi.fix_pathinfo = 1 in php.ini?" );
+                       return;
+               }
+
                if( strcmp( $wgScript, $url ) ) {
                        # Internet Explorer will ignore the Content-Type header if it
                        # thinks it sees a file extension it recognizes. Make sure that
@@ -164,7 +173,7 @@ class RawPage {
                $text = $this->getRawText();
 
                if( !wfRunHooks( 'RawPageViewBeforeOutput', array( &$this, &$text ) ) ) {
-                       wfDebug( __METHOD__ . ': RawPageViewBeforeOutput hook broke raw page output.' );
+                       wfDebug( __METHOD__ . ": RawPageViewBeforeOutput hook broke raw page output.\n" );
                }
 
                echo $text;