From: Brion Vibber Date: Tue, 17 Jul 2007 14:46:43 +0000 (+0000) Subject: * (bug 10615) Fix for transwiki import when CURL not available X-Git-Tag: 1.31.0-rc.0~52051 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=06e677c9c8feb41874675a8e5cd4ccb0fa146b62;p=lhc%2Fweb%2Fwiklou.git * (bug 10615) Fix for transwiki import when CURL not available Was doing a POST without sending Content-Length header, which some web servers get real pissy about. Now sends a 'Content-Length: 0' header --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 757614a31d..d2a4a494c6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index c528f6c0ce..249798a20b 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -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 );