* (bug 27924) PhpHttpRequest doesn't return response body if HTTP != 200
authorSam Reed <reedy@users.mediawiki.org>
Thu, 17 Mar 2011 15:14:09 +0000 (15:14 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 17 Mar 2011 15:14:09 +0000 (15:14 +0000)
Apply Bawolffs patch minus the var_dump()'s

RELEASE-NOTES
includes/HttpFunctions.php

index 649c444..c730830 100644 (file)
@@ -115,6 +115,7 @@ PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 2581, bug 6834) Added links to thumbnail in several resolutions to the 
   file description page. The sizes are set by $wgImageLimits.
 * (bug 28031) Add pageCount support to ArchivedFile
+* (bug 27924) PhpHttpRequest doesn't return response body if HTTP != 200
 
 === Bug fixes in 1.18 ===
 * (bug 23119) WikiError class and subclasses are now marked as deprecated
index cd919b4..841b341 100644 (file)
@@ -785,7 +785,10 @@ class PhpHttpRequest extends MWHttpRequest {
                        return $this->status;
                }
 
-               if ( $this->status->isOK() ) {
+               // If everything went OK, or we recieved some error code
+               // get the response body content.
+               if ( $this->status->isOK()
+                               || (int)$this->respStatus >= 300) {
                        while ( !feof( $fh ) ) {
                                $buf = fread( $fh, 8192 );