Fixes Bug #28214 - When page not found, sends malformed HTTP/1.x instead of HTTP...
authorMark A. Hershberger <mah@users.mediawiki.org>
Fri, 25 Mar 2011 03:36:18 +0000 (03:36 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Fri, 25 Mar 2011 03:36:18 +0000 (03:36 +0000)
Note that there are a few places in the source where headers are sent
with HTTP/1.0 instead of HTTP/1.1 but this patch doesa not address those

includes/Article.php
includes/ImagePage.php
includes/WebStart.php

index 3df5066..53334b5 100644 (file)
@@ -1404,7 +1404,7 @@ class Article {
                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 );
index 0bbf58b..ba544b9 100644 (file)
@@ -520,7 +520,7 @@ EOT
                        if ( !$this->getID() ) {
                                // If there is no image, no shared image, and no description page,
                                // output a 404, to be consistent with articles.
-                               $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
+                               $wgRequest->response()->header( "HTTP/1.1 404 Not Found" );
                        }
                }
        }
index 27670ad..2c21cdb 100644 (file)
@@ -34,7 +34,7 @@ if ( ini_get( 'register_globals' ) ) {
        );
        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 );
                }