https://bugzilla.wikimedia.org/show_bug.cgi?id=28214

           Summary: Malformed header
           Product: MediaWiki
           Version: wikimedia-deployment
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: Normal
         Component: Page editing
        AssignedTo: [email protected]
        ReportedBy: [email protected]


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 );
         }

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to