### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
293 | 293 | $transports = WP_Http::_getTransport( $r ); |
294 | 294 | } else { |
295 | 295 | if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { |
296 | | if ( ! version_compare(phpversion(), '5.1.2', '>=') ) |
297 | | $r['body'] = _http_build_query( $r['body'], null, '&' ); |
298 | | else |
299 | | $r['body'] = http_build_query( $r['body'], null, '&' ); |
| 296 | $r['body'] = http_build_query( $r['body'], null, '&' ); |
300 | 297 | $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); |
301 | 298 | $r['headers']['Content-Length'] = strlen( $r['body'] ); |
302 | 299 | } |
… |
… |
|
1108 | 1105 | if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) ) |
1109 | 1106 | return false; |
1110 | 1107 | |
1111 | | if ( version_compare(PHP_VERSION, '5.0', '<') ) |
1112 | | return false; |
1113 | | |
1114 | | //HTTPS via Proxy was added in 5.1.0 |
1115 | 1108 | $is_ssl = isset($args['ssl']) && $args['ssl']; |
1116 | | if ( $is_ssl && version_compare(PHP_VERSION, '5.1.0', '<') ) { |
| 1109 | if ( $is_ssl ) { |
1117 | 1110 | $proxy = new WP_HTTP_Proxy(); |
1118 | 1111 | /** |
1119 | 1112 | * No URL check, as its not currently passed to the ::test() function |
… |
… |
|
1329 | 1322 | |
1330 | 1323 | if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { |
1331 | 1324 | |
1332 | | $isPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); |
| 1325 | curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); |
| 1326 | curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); |
| 1327 | curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); |
1333 | 1328 | |
1334 | | if ( $isPHP5 ) { |
1335 | | curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); |
1336 | | curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); |
1337 | | curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); |
1338 | | } else { |
1339 | | curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() .':'. $proxy->port() ); |
1340 | | } |
1341 | | |
1342 | 1329 | if ( $proxy->use_authentication() ) { |
1343 | | if ( $isPHP5 ) |
1344 | | curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); |
1345 | | |
| 1330 | curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); |
1346 | 1331 | curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() ); |
1347 | 1332 | } |
1348 | 1333 | } |