* (bug 10615) Fix for transwiki import when CURL not available
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 17 Jul 2007 14:46:43 +0000 (14:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 17 Jul 2007 14:46:43 +0000 (14:46 +0000)
Was doing a POST without sending Content-Length header, which some web servers get real pissy about.
Now sends a 'Content-Length: 0' header

RELEASE-NOTES
includes/HttpFunctions.php

index 757614a..d2a4a49 100644 (file)
@@ -310,6 +310,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 1629) Stop section edit links from being shoved down by other floats
 * (bug 4650) Keep impossibly large/small counts off Special:Statistics
 * (bug 10608) PHP notice when installing with PostgreSQL
+* (bug 10615) Fix for transwiki import when CURL not available
+
 
 == API changes since 1.10 ==
 
index c528f6c..249798a 100644 (file)
@@ -63,6 +63,10 @@ class Http {
                        # This may take 3 minutes to time out, and doesn't have local fetch capabilities
 
                        $opts = array('http' => array( 'method' => $method ) );
+                       if( strcasecmp( $method, 'post' ) == 0 ) {
+                               // Required for HTTP 1.0 POSTs
+                               $opts['http']['header'] = "Content-Length: 0";
+                       }
                        $ctx = stream_context_create($opts);
 
                        $url_fopen = ini_set( 'allow_url_fopen', 1 );