Changeset 10642
- Timestamp:
- 02/24/2009 07:37:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/http.php
r10639 r10642 229 229 230 230 if ( is_null($working_transport) ) { 231 if ( true === WP_Http_ExtHttp::test( ) ) {231 if ( true === WP_Http_ExtHttp::test($args) ) { 232 232 $working_transport['exthttp'] = new WP_Http_ExtHttp(); 233 233 $blocking_transport[] = &$working_transport['exthttp']; 234 } else if ( true === WP_Http_Curl::test( ) ) {234 } else if ( true === WP_Http_Curl::test($args) ) { 235 235 $working_transport['curl'] = new WP_Http_Curl(); 236 236 $blocking_transport[] = &$working_transport['curl']; 237 } else if ( true === WP_Http_Streams::test( ) ) {237 } else if ( true === WP_Http_Streams::test($args) ) { 238 238 $working_transport['streams'] = new WP_Http_Streams(); 239 239 $blocking_transport[] = &$working_transport['streams']; 240 } else if ( true === WP_Http_Fopen::test( ) && ( isset($args['ssl']) && !$args['ssl']) ) {240 } else if ( true === WP_Http_Fopen::test($args) ) { 241 241 $working_transport['fopen'] = new WP_Http_Fopen(); 242 242 $blocking_transport[] = &$working_transport['fopen']; 243 } else if ( true === WP_Http_Fsockopen::test( ) && ( isset($args['ssl']) && !$args['ssl']) ) {243 } else if ( true === WP_Http_Fsockopen::test($args) ) { 244 244 $working_transport['fsockopen'] = new WP_Http_Fsockopen(); 245 245 $blocking_transport[] = &$working_transport['fsockopen']; … … 280 280 281 281 if ( is_null($working_transport) ) { 282 if ( true === WP_Http_ExtHttp::test( ) ) {282 if ( true === WP_Http_ExtHttp::test($args) ) { 283 283 $working_transport['exthttp'] = new WP_Http_ExtHttp(); 284 284 $blocking_transport[] = &$working_transport['exthttp']; 285 } else if ( true === WP_Http_Curl::test( ) ) {285 } else if ( true === WP_Http_Curl::test($args) ) { 286 286 $working_transport['curl'] = new WP_Http_Curl(); 287 287 $blocking_transport[] = &$working_transport['curl']; 288 } else if ( true === WP_Http_Streams::test( ) ) {288 } else if ( true === WP_Http_Streams::test($args) ) { 289 289 $working_transport['streams'] = new WP_Http_Streams(); 290 290 $blocking_transport[] = &$working_transport['streams']; 291 } else if ( true === WP_Http_Fsockopen::test( ) && ( isset($args['ssl']) && !$args['ssl']) ) {291 } else if ( true === WP_Http_Fsockopen::test($args) ) { 292 292 $working_transport['fsockopen'] = new WP_Http_Fsockopen(); 293 293 $blocking_transport[] = &$working_transport['fsockopen']; … … 387 387 $r['ssl'] = false; 388 388 389 // Determine if this request is to OUR install of WordPress 390 if ( stristr(get_bloginfo('url'), $arrURL['host']) ) 391 $r['local'] = true; 392 else 393 $r['local'] = false; 394 389 395 if ( is_null( $r['headers'] ) ) 390 396 $r['headers'] = array(); … … 847 853 * @return boolean False means this class can not be used, true means it can. 848 854 */ 849 function test( ) {855 function test($args = array()) { 850 856 if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours 851 857 return false; 852 858 853 if ( function_exists( 'fsockopen' ) )859 if ( function_exists( 'fsockopen' ) && ( isset($args['ssl']) && !$args['ssl'] ) ) 854 860 return apply_filters('use_fsockopen_transport', true); 855 861 … … 964 970 return false; 965 971 966 return apply_filters('use_fopen_transport', true); 972 if ( 973 ( isset($args['ssl']) && !$args['ssl'] ) || 974 ( isset($args['local']) && $args['local'] == true && apply_filters('https_local_ssl_verify', true) != true ) || 975 ( isset($args['local']) && $args['local'] == false && apply_filters('https_ssl_verify', true) != true ) || 976 ( isset($args['sslverify']) && !$args['sslverify'] ) 977 ) 978 return apply_filters('use_fopen_transport', true); 979 980 return false; 967 981 } 968 982 } … … 1095 1109 * @return boolean False means this class can not be used, true means it can. 1096 1110 */ 1097 function test( ) {1111 function test($args = array()) { 1098 1112 if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) ) 1099 1113 return false; … … 1222 1236 * @return boolean False means this class can not be used, true means it can. 1223 1237 */ 1224 function test( ) {1238 function test($args = array()) { 1225 1239 if ( function_exists('http_request') ) 1226 1240 return apply_filters('use_http_extension_transport', true); … … 1375 1389 * @return boolean False means this class can not be used, true means it can. 1376 1390 */ 1377 function test( ) {1391 function test($args = array()) { 1378 1392 if ( function_exists('curl_init') && function_exists('curl_exec') ) 1379 1393 return apply_filters('use_curl_transport', true);
Note: See TracChangeset
for help on using the changeset viewer.