| 761 | | return apply_filters('use_fsockopen_transport', $use, $args); |
| | 755 | // check if the requested scheme is allowed |
| | 756 | $use = in_array( $scheme, $allowed_schemes ); |
| | 757 | |
| | 758 | // check if fsockopen has been disabled for 12 hours |
| | 759 | if ( $use ) |
| | 760 | $use = ( $option = get_option( 'disable_fsockopen', 0 ) ) && time() - $option < 43200; // 43200 = 12 hours |
| | 761 | |
| | 762 | // check if there is a function named fsockopen |
| | 763 | if ( $use ) |
| | 764 | $use = function_exists( 'fsockopen' ); |
| | 765 | |
| | 766 | // check if openssl is available for SSL transports |
| | 767 | if ( $use && $is_ssl ) |
| | 768 | $use = extension_loaded( 'openssl' ); |
| | 769 | |
| | 770 | return apply_filters('use_fsockopen_transport', $use, $args, $url); |
| 936 | | return apply_filters('use_streams_transport', true, $args); |
| | 944 | $scheme = empty($url) ? 'http' : strtolower( parse_url( $url, PHP_URL_SCHEME ) ); |
| | 945 | |
| | 946 | $allowed_schemes = array( 'http', 'https' ); |
| | 947 | |
| | 948 | // check if the requested scheme is allowed |
| | 949 | $use = in_array( $scheme, $allowed_schemes ); |
| | 950 | |
| | 951 | // check if the fopen function exists |
| | 952 | if ( $use ) |
| | 953 | $use = function_exists( 'fopen' ); |
| | 954 | |
| | 955 | // check if url fopen is allowed |
| | 956 | if ( $use ) |
| | 957 | $use = function_exists( 'ini_get' ) && ini_get( 'allow_url_fopen' ); |
| | 958 | |
| | 959 | // check if requested scheme has a stream wrapper |
| | 960 | if ( $use ) |
| | 961 | $use = in_array( $scheme, stream_get_wrappers() ); |
| | 962 | |
| | 963 | // check specifically against openssl extension |
| | 964 | if ( $use && $is_ssl ) |
| | 965 | $use = extension_loaded( 'openssl' ); |
| | 966 | |
| | 967 | // check if streams actually support ssl |
| | 968 | if ( $use && $is_ssl ) |
| | 969 | $use = in_array( 'ssl', stream_get_transports() ); |
| | 970 | |
| | 971 | return (bool) apply_filters( 'use_streams_transport', $use, $args, $url ); |
| 1099 | | function test($args = array()) { |
| 1100 | | return apply_filters('use_http_extension_transport', function_exists('http_request'), $args ); |
| | 1134 | function test($args = array(), $url = null) { |
| | 1135 | |
| | 1136 | $is_ssl = isset( $args['ssl'] ) && $args['ssl']; |
| | 1137 | |
| | 1138 | $scheme = empty( $url ) ? 'http' : strtolower( parse_url( $url, PHP_URL_SCHEME ) ); |
| | 1139 | |
| | 1140 | $allowed_schemes = array( 'http', 'https' ); |
| | 1141 | |
| | 1142 | // check if the requested scheme is allowed |
| | 1143 | $use = in_array( $scheme, $allowed_schemes ); |
| | 1144 | |
| | 1145 | // check if there is a function named curl_init |
| | 1146 | if ( $use ) |
| | 1147 | $use = function_exists( 'http_request' ); |
| | 1148 | |
| | 1149 | return (bool) apply_filters( 'use_http_extension_transport', $use, $args, $url ); |
| 1319 | | return false; |
| | 1366 | $is_ssl = isset( $args['ssl'] ) && $args['ssl']; |
| | 1367 | |
| | 1368 | $scheme = empty( $url ) ? 'http' : strtolower( parse_url( $url, PHP_URL_SCHEME ) ); |
| | 1369 | |
| | 1370 | $allowed_schemes = array( 'http', 'https' ); |
| | 1371 | |
| | 1372 | // check if the requested scheme is allowed |
| | 1373 | $use = in_array( $scheme, $allowed_schemes ); |
| | 1374 | |
| | 1375 | // check if there is a function named curl_init |
| | 1376 | if ( $use ) |
| | 1377 | $use = function_exists( 'curl_init' ); |
| | 1378 | |
| | 1379 | // check if there is a function named curl_exec |
| | 1380 | if ( $use ) |
| | 1381 | $use = function_exists( 'curl_exec' ); |
| | 1382 | |
| | 1383 | // check if openssl is available for SSL transports |
| | 1384 | if ( $use && $is_ssl ) |
| | 1385 | $use = extension_loaded( 'openssl' ); |
| | 1386 | |
| | 1387 | return (bool) apply_filters( 'use_curl_transport', $use, $args, $url ); |