Changeset 17598
- Timestamp:
- 04/05/2011 06:09:43 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-http.php
r17597 r17598 743 743 */ 744 744 function test( $args = array() ) { 745 if ( ! function_exists( 'fsockopen' ) ) 746 return false; 747 745 748 if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours 746 749 return false; 747 750 748 $is_ssl = isset($args['ssl']) && $args['ssl']; 749 750 if ( ! $is_ssl && function_exists( 'fsockopen' ) ) 751 $use = true; 752 elseif ( $is_ssl && extension_loaded('openssl') && function_exists( 'fsockopen' ) ) 753 $use = true; 754 else 755 $use = false; 756 757 return apply_filters('use_fsockopen_transport', $use, $args); 751 $is_ssl = isset( $args['ssl'] ) && $args['ssl']; 752 753 if ( $is_ssl && ! extension_loaded( 'openssl' ) ) 754 return false; 755 756 return apply_filters( 'use_fsockopen_transport', true, $args ); 758 757 } 759 758 } … … 926 925 * @return boolean False means this class can not be used, true means it can. 927 926 */ 928 function test( $args = array()) {929 if ( ! function_exists( 'fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) )927 function test( $args = array() ) { 928 if ( ! function_exists( 'fopen' ) ) 930 929 return false; 931 930 932 return apply_filters('use_streams_transport', true, $args); 931 if ( ! function_exists( 'ini_get' ) || true != ini_get( 'allow_url_fopen' ) ) 932 return false; 933 934 $is_ssl = isset( $args['ssl'] ) && $args['ssl']; 935 936 if ( $is_ssl && ! extension_loaded( 'openssl' ) ) 937 return false; 938 939 return apply_filters( 'use_streams_transport', true, $args ); 933 940 } 934 941 } … … 1309 1316 * @return boolean False means this class can not be used, true means it can. 1310 1317 */ 1311 function test($args = array()) { 1312 if ( function_exists('curl_init') && function_exists('curl_exec') ) 1313 return apply_filters('use_curl_transport', true, $args); 1314 1315 return false; 1318 function test( $args = array() ) { 1319 if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) 1320 return false; 1321 1322 $is_ssl = isset( $args['ssl'] ) && $args['ssl']; 1323 1324 if ( $is_ssl ) { 1325 $curl_version = curl_version(); 1326 if ( ! (CURL_VERSION_SSL & $curl_version['features']) ) // Does this cURL version support SSL requests? 1327 return false; 1328 } 1329 1330 return apply_filters( 'use_curl_transport', true, $args ); 1316 1331 } 1317 1332 }
Note: See TracChangeset
for help on using the changeset viewer.