Author: scott
Description:
When using suPHP and visiting a non existent entry it generates a malformed header error because its defining HTTP/1.x
The exact error is,
malformed header from script. Bad header=HTTP/1.x 404 Not Found: index.php
The offending line is
includes/Article.php
$wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
This should be
$wgRequest->response()->header( "HTTP/1.1 404 Not Found" );
The same also applies to
includes/WebStart.php
Which has the same problem when defining an 500, Internal Server Error.
Here is the diff to fix the problem,
diff -Naur mediawiki-1.16.2-original/includes/Article.php mediawiki-1.16.2/includes/Article.php
- mediawiki-1.16.2-original/includes/Article.php 2011-01-04 06:15:54.000000000 +0000
+++ mediawiki-1.16.2/includes/Article.php 2011-03-24 03:11:42.000000000 +0000
@@ -1278,7 +1278,7 @@
if ( !$this->hasViewableContent() ) { // If there's no backing content, send a 404 Not Found // for better machine handling of broken links.
- $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
+ $wgRequest->response()->header( "HTTP/1.1 404 Not Found" );
} $wgOut->addWikiText( $text ); }
diff -Naur mediawiki-1.16.2-original/includes/WebStart.php mediawiki-1.16.2/includes/WebStart.php
- mediawiki-1.16.2-original/includes/WebStart.php 2009-05-07 19:30:26.000000000 +0100
+++ mediawiki-1.16.2/includes/WebStart.php 2011-03-24 03:11:50.000000000 +0000
@@ -30,7 +30,7 @@
); foreach ( $_REQUEST as $name => $value ) { if( in_array( $name, $verboten ) ) {
- header( "HTTP/1.x 500 Internal Server Error" );
+ header( "HTTP/1.1 500 Internal Server Error" );
echo "register_globals security paranoia: trying to overwrite superglobals, aborting."; die( -1 ); }
Version: unspecified
Severity: trivial