Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -139,6 +139,8 @@ |
140 | 140 | * php's HTTP extension. |
141 | 141 | */ |
142 | 142 | class MWHttpRequest { |
| 143 | + const SUPPORTS_FILE_POSTS = false; |
| 144 | + |
143 | 145 | protected $content; |
144 | 146 | protected $timeout = 'default'; |
145 | 147 | protected $headersOnly = null; |
— | — | @@ -344,10 +346,6 @@ |
345 | 347 | $this->headersOnly = true; |
346 | 348 | } |
347 | 349 | |
348 | | - if ( is_array( $this->postData ) ) { |
349 | | - $this->postData = wfArrayToCGI( $this->postData ); |
350 | | - } |
351 | | - |
352 | 350 | if ( is_object( $wgTitle ) && !isset( $this->reqHeaders['Referer'] ) ) { |
353 | 351 | $this->setReferer( $wgTitle->getFullURL() ); |
354 | 352 | } |
— | — | @@ -801,6 +799,8 @@ |
802 | 800 | * MWHttpRequest implemented using internal curl compiled into PHP |
803 | 801 | */ |
804 | 802 | class CurlHttpRequest extends MWHttpRequest { |
| 803 | + const SUPPORTS_FILE_POSTS = true; |
| 804 | + |
805 | 805 | static $curlMessageMap = array( |
806 | 806 | 6 => 'http-host-unreachable', |
807 | 807 | 28 => 'http-timed-out' |
— | — | @@ -925,6 +925,10 @@ |
926 | 926 | public function execute() { |
927 | 927 | parent::execute(); |
928 | 928 | |
| 929 | + if ( is_array( $this->postData ) ) { |
| 930 | + $this->postData = wfArrayToCGI( $this->postData ); |
| 931 | + } |
| 932 | + |
929 | 933 | // At least on Centos 4.8 with PHP 5.1.6, using max_redirects to follow redirects |
930 | 934 | // causes a segfault |
931 | 935 | $manuallyRedirect = version_compare( phpversion(), '5.1.7', '<' ); |