Changeset 17535
- Timestamp:
- 03/23/2011 11:58:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-http.php
r17534 r17535 289 289 } else { 290 290 if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { 291 if ( ! version_compare(phpversion(), '5.1.2', '>=') ) 292 $r['body'] = _http_build_query( $r['body'], null, '&' ); 293 else 294 $r['body'] = http_build_query( $r['body'], null, '&' ); 291 $r['body'] = http_build_query( $r['body'], null, '&' ); 295 292 $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); 296 293 $r['headers']['Content-Length'] = strlen( $r['body'] ); … … 955 952 return false; 956 953 957 if ( version_compare(PHP_VERSION, '5.0', '<') )958 return false;959 960 //HTTPS via Proxy was added in 5.1.0961 $is_ssl = isset($args['ssl']) && $args['ssl'];962 if ( $is_ssl && version_compare(PHP_VERSION, '5.1.0', '<') ) {963 $proxy = new WP_HTTP_Proxy();964 /**965 * No URL check, as its not currently passed to the ::test() function966 * In the case where a Proxy is in use, Just bypass this transport for HTTPS.967 */968 if ( $proxy->is_enabled() )969 return false;970 }971 972 954 return apply_filters('use_streams_transport', true, $args); 973 955 } … … 1176 1158 if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { 1177 1159 1178 $isPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); 1179 1180 if ( $isPHP5 ) { 1181 curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); 1182 curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); 1183 curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); 1184 } else { 1185 curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() .':'. $proxy->port() ); 1186 } 1160 curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); 1161 curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); 1162 curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); 1187 1163 1188 1164 if ( $proxy->use_authentication() ) { 1189 if ( $isPHP5 ) 1190 curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); 1191 1165 curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); 1192 1166 curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() ); 1193 1167 }
Note: See TracChangeset
for help on using the changeset viewer.