Ticket #4779: 4779.r8523.diff
File 4779.r8523.diff, 3.9 KB (added by , 16 years ago) |
---|
-
http.php
88 88 static $working_transport; 89 89 90 90 if ( is_null($working_transport) ) { 91 if ( true === WP_Http_Streams::test() ) 91 if ( true === WP_Http_ExtHttp::test() ) 92 $working_transport = new WP_Http_ExtHttp(); 93 else if ( true === WP_Http_Curl::test() ) 94 $working_transport = new WP_Http_Curl(); 95 else if ( true === WP_Http_Streams::test() ) 92 96 $working_transport = new WP_Http_Streams(); 93 else if ( true === WP_Http_ExtHttp::test() )94 $working_transport = new WP_Http_ExtHttp();95 97 else if ( true === WP_Http_Fopen::test() ) 96 98 $working_transport = new WP_Http_Fopen(); 97 99 else if ( true === WP_Http_Fsockopen::test() ) … … 119 121 static $working_transport; 120 122 121 123 if ( is_null($working_transport) ) { 122 if ( true === WP_Http_Streams::test() ) 124 if ( true === WP_Http_ExtHttp::test() ) 125 $working_transport = new WP_Http_ExtHttp(); 126 else if ( true === WP_Http_Streams::test() ) 123 127 $working_transport = new WP_Http_Streams(); 124 else if ( true === WP_Http_ExtHttp::test() )125 $working_transport = new WP_Http_ExtHttp();126 128 else if ( true === WP_Http_Fsockopen::test() ) 127 129 $working_transport = new WP_Http_Fsockopen(); 128 130 } … … 193 195 if ( ! isset($headers['user-agent']) || ! isset($headers['User-Agent']) ) 194 196 $headers['user-agent'] = $r['user-agent']; 195 197 196 if ( is_null($body) || count($headers) > 1)198 if ( is_null($body) ) 197 199 $transport = WP_Http::_getTransport(); 198 200 else 199 201 $transport = WP_Http::_postTransport(); 200 202 201 return $transport->request($url, $ headers, $body, $r);203 return $transport->request($url, $r, $headers, $body); 202 204 } 203 205 204 206 /** … … 218 220 function post($url, $args = array(), $headers = null, $body = null) { 219 221 $defaults = array('method' => 'POST'); 220 222 $r = wp_parse_args( $args, $defaults ); 221 return $this->request($url, $ headers, $body, $r);223 return $this->request($url, $r, $headers, $body); 222 224 } 223 225 224 226 /** … … 238 240 function get($url, $args = array(), $headers = null, $body = null) { 239 241 $defaults = array('method' => 'GET'); 240 242 $r = wp_parse_args( $args, $defaults ); 241 return $this->request($url, $ headers, $body, $r);243 return $this->request($url, $r, $headers, $body); 242 244 } 243 245 244 246 /** … … 694 696 * 695 697 * @param string $url 696 698 * @param str|array $args Optional. Override the defaults. 697 * @param string|array $headers Optional. Either the header string or array of Header name and value pairs. Expects sanitized.699 * @param array $headers Optional. Either the header string or array of Header name and value pairs. Expects sanitized. 698 700 * @param string $body Optional. The body that should be sent. Expected to be already processed. 699 701 * @return array 'headers', 'body', and 'response' keys. 700 702 */ … … 936 938 function wp_remote_request($url, $args = array(), $headers = null, $body = null) { 937 939 $objFetchSite = _wp_http_get_object(); 938 940 939 return $objFetchSite->request($url, $ headers, $body, $args);941 return $objFetchSite->request($url, $args, $headers, $body); 940 942 } 941 943 942 944 /** … … 955 957 function wp_remote_get($url, $args = array(), $headers = null, $body = null) { 956 958 $objFetchSite = _wp_http_get_object(); 957 959 958 return $objFetchSite->get($url, $ headers, $body, $args);960 return $objFetchSite->get($url, $args, $headers, $body); 959 961 } 960 962 961 963 /** … … 974 976 function wp_remote_post($url, $args = array(), $headers = null, $body = null) { 975 977 $objFetchSite = _wp_http_get_object(); 976 978 977 return $objFetchSite->post($url, $ headers, $body, $args);979 return $objFetchSite->post($url, $args, $headers, $body); 978 980 } 979 981 980 982 /** … … 993 995 function wp_remote_head($url, $args = array(), $headers = null, $body = null) { 994 996 $objFetchSite = _wp_http_get_object(); 995 997 996 return $objFetchSite->head($url, $ headers, $body, $args);998 return $objFetchSite->head($url, $args, $headers, $body); 997 999 } 998 1000 999 1001 /**