Proxy support. Props DD32. see #4011
git-svn-id: http://svn.automattic.com/wordpress/trunk@10864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d859e9dd3b
commit
93c512ded4
|
@ -243,16 +243,12 @@ class WP_Http {
|
|||
|
||||
// Determine if this is a https call and pass that on to the transport functions
|
||||
// so that we can blacklist the transports that do not support ssl verification
|
||||
if ( $arrURL['scheme'] == 'https' || $arrURL['scheme'] == 'ssl' )
|
||||
$r['ssl'] = true;
|
||||
else
|
||||
$r['ssl'] = false;
|
||||
$r['ssl'] = $arrURL['scheme'] == 'https' || $arrURL['scheme'] == 'ssl';
|
||||
|
||||
// Determine if this request is to OUR install of WordPress
|
||||
if ( stristr(get_bloginfo('url'), $arrURL['host']) )
|
||||
$r['local'] = true;
|
||||
else
|
||||
$r['local'] = false;
|
||||
$homeURL = parse_url(get_bloginfo('url'));
|
||||
$r['local'] = $homeURL['host'] == $arrURL['host'] || 'localhost' == $arrURL['host'];
|
||||
unset($homeURL);
|
||||
|
||||
if ( is_null( $r['headers'] ) )
|
||||
$r['headers'] = array();
|
||||
|
@ -419,11 +415,12 @@ class WP_Http {
|
|||
|
||||
if ( !empty( $value ) ) {
|
||||
$key = strtolower( $key );
|
||||
if ( isset( $newheaders[$key] ) ) {
|
||||
|
||||
if ( isset( $newheaders[$key] ) )
|
||||
$newheaders[$key] = array( $newheaders[$key], trim( $value ) );
|
||||
} else {
|
||||
else
|
||||
$newheaders[$key] = trim( $value );
|
||||
}
|
||||
|
||||
if ( 'set-cookie' == strtolower( $key ) )
|
||||
$cookies[] = new WP_Http_Cookie( $value );
|
||||
}
|
||||
|
@ -448,9 +445,8 @@ class WP_Http {
|
|||
function buildCookieHeader( &$r ) {
|
||||
if ( ! empty($r['cookies']) ) {
|
||||
$cookies_header = '';
|
||||
foreach ( (array) $r['cookies'] as $cookie ) {
|
||||
foreach ( (array) $r['cookies'] as $cookie )
|
||||
$cookies_header .= $cookie->getHeaderValue() . '; ';
|
||||
}
|
||||
$cookies_header = substr( $cookies_header, 0, -2 );
|
||||
$r['headers']['cookie'] = $cookies_header;
|
||||
}
|
||||
|
@ -510,7 +506,8 @@ class WP_Http {
|
|||
*
|
||||
* You block external URL requests by defining WP_HTTP_BLOCK_EXTERNAL in your wp-config.php file
|
||||
* and this will only allow localhost and your blog to make requests. The constant
|
||||
* WP_ACCESSABLE_HOSTS will allow additional hosts to go through for requests.
|
||||
* WP_ACCESSABLE_HOSTS will allow additional hosts to go through for requests. The format of the
|
||||
* WP_ACCESSABLE_HOSTS constant is a comma separated list of hostnames to allow.
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
|
||||
|
@ -537,17 +534,20 @@ class WP_Http {
|
|||
if ( $check === false )
|
||||
return false;
|
||||
|
||||
$home = parse_url( get_bloginfo('site_url') );
|
||||
$home = parse_url( get_option('siteurl') );
|
||||
|
||||
// Don't block requests back to ourselves by default
|
||||
if ( $uri == 'localhost' || $uri == $home['host'] )
|
||||
if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] )
|
||||
return apply_filters('block_local_requests', false);
|
||||
|
||||
if ( defined('WP_ACCESSABLE_HOSTS') && is_array( WP_ACCESSABLE_HOSTS ) && in_array( $check['host'], WP_ACCESSABLE_HOSTS ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !defined('WP_ACCESSABLE_HOSTS') )
|
||||
return true;
|
||||
|
||||
static $accessable_hosts;
|
||||
if ( null == $accessable_hosts )
|
||||
$accessable_hosts = preg_split('|,\s*|', WP_ACCESSABLE_HOSTS);
|
||||
|
||||
return !in_array( $check['host'], $accessable_hosts ); //Inverse logic, If its in the array, then we can't access it.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,13 +606,11 @@ class WP_Http_Fsockopen {
|
|||
if ( ! isset($arrURL['port']) ) {
|
||||
if ( ($arrURL['scheme'] == 'ssl' || $arrURL['scheme'] == 'https') && extension_loaded('openssl') ) {
|
||||
$arrURL['host'] = 'ssl://' . $arrURL['host'];
|
||||
$arrURL['port'] = apply_filters('http_request_port', 443);
|
||||
$arrURL['port'] = 443;
|
||||
$secure_transport = true;
|
||||
} else {
|
||||
$arrURL['port'] = apply_filters('http_request_default_port', 80);
|
||||
$arrURL['port'] = 80;
|
||||
}
|
||||
} else {
|
||||
$arrURL['port'] = apply_filters('http_request_port', $arrURL['port'], $arrURL['host']);
|
||||
}
|
||||
|
||||
// There are issues with the HTTPS and SSL protocols that cause errors that can be safely
|
||||
|
@ -629,8 +627,7 @@ class WP_Http_Fsockopen {
|
|||
$handle = @fsockopen($proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
|
||||
else
|
||||
$handle = @fsockopen($arrURL['host'], $arrURL['port'], $iError, $strError, $r['timeout'] );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
|
||||
$handle = fsockopen($proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
|
||||
else
|
||||
|
@ -648,15 +645,17 @@ class WP_Http_Fsockopen {
|
|||
if ( false === $handle )
|
||||
return new WP_Error('http_request_failed', $iError . ': ' . $strError);
|
||||
|
||||
// WordPress supports PHP 4.3, which has this function. Removed sanity checking for
|
||||
// performance reasons.
|
||||
stream_set_timeout($handle, $r['timeout'] );
|
||||
|
||||
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) //Some proxies require full URL in this field.
|
||||
$requestPath = $url;
|
||||
else
|
||||
$requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' );
|
||||
$requestPath = empty($requestPath) ? '/' : $requestPath;
|
||||
|
||||
$strHeaders = '';
|
||||
$strHeaders .= strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
|
||||
if ( empty($requestPath) )
|
||||
$requestPath .= '/';
|
||||
|
||||
$strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
|
||||
|
||||
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
|
||||
$strHeaders .= 'Host: ' . $arrURL['host'] . ':' . $arrURL['port'] . "\r\n";
|
||||
|
@ -673,9 +672,8 @@ class WP_Http_Fsockopen {
|
|||
$strHeaders .= $r['headers'];
|
||||
}
|
||||
|
||||
if ( $proxy->use_authentication() ) {
|
||||
if ( $proxy->use_authentication() )
|
||||
$strHeaders .= $proxy->authentication_header() . "\r\n";
|
||||
}
|
||||
|
||||
$strHeaders .= "\r\n";
|
||||
|
||||
|
@ -735,10 +733,16 @@ class WP_Http_Fsockopen {
|
|||
if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours
|
||||
return false;
|
||||
|
||||
if ( function_exists( 'fsockopen' ) && ( isset($args['ssl']) && !$args['ssl'] ) )
|
||||
return apply_filters('use_fsockopen_transport', true);
|
||||
$is_ssl = isset($args['ssl']) && $args['ssl'];
|
||||
|
||||
return false;
|
||||
if ( ! $is_ssl && function_exists( 'fsockopen' ) )
|
||||
$use = true;
|
||||
elseif ( $is_ssl && extension_loaded('openssl') && function_exists( 'fsockopen' ) )
|
||||
$use = true;
|
||||
else
|
||||
$use = false;
|
||||
|
||||
return apply_filters('use_fsockopen_transport', $use, $args);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -772,8 +776,6 @@ class WP_Http_Fopen {
|
|||
* @return array 'headers', 'body', 'cookies' and 'response' keys.
|
||||
*/
|
||||
function request($url, $args = array()) {
|
||||
global $http_response_header;
|
||||
|
||||
$defaults = array(
|
||||
'method' => 'GET', 'timeout' => 5,
|
||||
'redirection' => 5, 'httpversion' => '1.0',
|
||||
|
@ -799,8 +801,6 @@ class WP_Http_Fopen {
|
|||
if (! $handle)
|
||||
return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
|
||||
|
||||
// WordPress supports PHP 4.3, which has this function. Removed sanity
|
||||
// checking for performance reasons.
|
||||
stream_set_timeout($handle, $r['timeout'] );
|
||||
|
||||
if ( ! $r['blocking'] ) {
|
||||
|
@ -812,15 +812,14 @@ class WP_Http_Fopen {
|
|||
while ( ! feof($handle) )
|
||||
$strResponse .= fread($handle, 4096);
|
||||
|
||||
$theHeaders = '';
|
||||
if ( function_exists('stream_get_meta_data') ) {
|
||||
$meta = stream_get_meta_data($handle);
|
||||
$theHeaders = $meta['wrapper_data'];
|
||||
if ( isset( $meta['wrapper_data']['headers'] ) )
|
||||
$theHeaders = $meta['wrapper_data']['headers'];
|
||||
} else {
|
||||
if( ! isset( $http_response_header ) )
|
||||
global $http_response_header;
|
||||
//$http_response_header is a PHP reserved variable which is set in the current-scope when using the HTTP Wrapper
|
||||
//see http://php.oregonstate.edu/manual/en/reserved.variables.httpresponseheader.php
|
||||
$theHeaders = $http_response_header;
|
||||
}
|
||||
|
||||
|
@ -844,19 +843,28 @@ class WP_Http_Fopen {
|
|||
* @static
|
||||
* @return boolean False means this class can not be used, true means it can.
|
||||
*/
|
||||
function test() {
|
||||
function test($args = array()) {
|
||||
if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) )
|
||||
return false;
|
||||
|
||||
if (
|
||||
( isset($args['ssl']) && !$args['ssl'] ) ||
|
||||
( isset($args['local']) && $args['local'] == true && apply_filters('https_local_ssl_verify', true) != true ) ||
|
||||
( isset($args['local']) && $args['local'] == false && apply_filters('https_ssl_verify', true) != true ) ||
|
||||
( isset($args['sslverify']) && !$args['sslverify'] )
|
||||
)
|
||||
return apply_filters('use_fopen_transport', true);
|
||||
$use = true;
|
||||
|
||||
return false;
|
||||
//PHP does not verify SSL certs, We can only make a request via this transports if SSL Verification is turned off.
|
||||
$is_ssl = isset($args['ssl']) && $args['ssl'];
|
||||
if ( $is_ssl ) {
|
||||
$is_local = isset($args['local']) && $args['local'];
|
||||
$ssl_verify = isset($args['sslverify']) && $args['sslverify'];
|
||||
if ( $is_local && true != apply_filters('https_local_ssl_verify', true) )
|
||||
$use = true;
|
||||
elseif ( !$is_local && true != apply_filters('https_ssl_verify', true) )
|
||||
$use = true;
|
||||
elseif ( !$ssl_verify )
|
||||
$use = true;
|
||||
else
|
||||
$use = false;
|
||||
}
|
||||
|
||||
return apply_filters('use_fopen_transport', $use, $args);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -910,7 +918,7 @@ class WP_Http_Streams {
|
|||
return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url));
|
||||
|
||||
if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] )
|
||||
$url = str_replace($arrURL['scheme'], 'http', $url);
|
||||
$url = preg_replace('|^' . preg_quote($arrURL['scheme'], '|') . '|', 'http', $url);
|
||||
|
||||
// Convert Header array to string.
|
||||
$strHeaders = '';
|
||||
|
@ -920,6 +928,13 @@ class WP_Http_Streams {
|
|||
else if ( is_string( $r['headers'] ) )
|
||||
$strHeaders = $r['headers'];
|
||||
|
||||
$is_local = isset($args['local']) && $args['local'];
|
||||
$ssl_verify = isset($args['sslverify']) && $args['sslverify'];
|
||||
if ( $is_local )
|
||||
$ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify);
|
||||
elseif ( ! $is_local )
|
||||
$ssl_verify = apply_filters('https_ssl_verify', $ssl_verify);
|
||||
|
||||
$arrContext = array('http' =>
|
||||
array(
|
||||
'method' => strtoupper($r['method']),
|
||||
|
@ -929,8 +944,8 @@ class WP_Http_Streams {
|
|||
'header' => $strHeaders,
|
||||
'timeout' => $r['timeout'],
|
||||
'ssl' => array(
|
||||
'verify_peer' => apply_filters('https_ssl_verify', $r['sslverify']),
|
||||
'verify_host' => apply_filters('https_ssl_verify', $r['sslverify'])
|
||||
'verify_peer' => $ssl_verify,
|
||||
'verify_host' => $ssl_verify
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -939,12 +954,12 @@ class WP_Http_Streams {
|
|||
|
||||
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
|
||||
$arrContext['http']['proxy'] = 'tcp://' . $proxy->host() . ':' . $proxy->port();
|
||||
$arrContext['http']['request_fulluri'] = true;
|
||||
|
||||
// We only support Basic authentication so this will only work if that is what your proxy supports.
|
||||
if ( $proxy->use_authentication() ) {
|
||||
if ( $proxy->use_authentication() )
|
||||
$arrContext['http']['header'] .= $proxy->authentication_header() . "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_null($r['body']) && ! empty($r['body'] ) )
|
||||
$arrContext['http']['content'] = $r['body'];
|
||||
|
@ -1005,7 +1020,19 @@ class WP_Http_Streams {
|
|||
if ( version_compare(PHP_VERSION, '5.0', '<') )
|
||||
return false;
|
||||
|
||||
return apply_filters('use_streams_transport', true);
|
||||
//HTTPS via Proxy was added in 5.1.0
|
||||
$is_ssl = isset($args['ssl']) && $args['ssl'];
|
||||
if ( $is_ssl && version_compare(PHP_VERSION, '5.1.0', '<') ) {
|
||||
$proxy = new WP_HTTP_Proxy();
|
||||
/**
|
||||
* No URL check, as its not currently passed to the ::test() function
|
||||
* In the case where a Proxy is in use, Just bypass this transport for HTTPS.
|
||||
*/
|
||||
if ( $proxy->is_enabled() )
|
||||
return false;
|
||||
}
|
||||
|
||||
return apply_filters('use_streams_transport', true, $args);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1069,7 +1096,14 @@ class WP_Http_ExtHTTP {
|
|||
$arrURL = parse_url($url);
|
||||
|
||||
if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
|
||||
$url = str_replace($arrURL['scheme'], 'http', $url);
|
||||
$url = preg_replace('|^' . preg_quote($arrURL['scheme'], '|') . '|', 'http', $url);
|
||||
|
||||
$is_local = isset($args['local']) && $args['local'];
|
||||
$ssl_verify = isset($args['sslverify']) && $args['sslverify'];
|
||||
if ( $is_local )
|
||||
$ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify);
|
||||
elseif ( ! $is_local )
|
||||
$ssl_verify = apply_filters('https_ssl_verify', $ssl_verify);
|
||||
|
||||
$options = array(
|
||||
'timeout' => $r['timeout'],
|
||||
|
@ -1078,8 +1112,8 @@ class WP_Http_ExtHTTP {
|
|||
'useragent' => $r['user-agent'],
|
||||
'headers' => $r['headers'],
|
||||
'ssl' => array(
|
||||
'verifypeer' => apply_filters('https_ssl_verify', $r['sslverify']),
|
||||
'verifyhost' => apply_filters('https_ssl_verify', $r['sslverify'])
|
||||
'verifypeer' => $ssl_verify,
|
||||
'verifyhost' => $ssl_verify
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -1139,10 +1173,7 @@ class WP_Http_ExtHTTP {
|
|||
* @return boolean False means this class can not be used, true means it can.
|
||||
*/
|
||||
function test($args = array()) {
|
||||
if ( function_exists('http_request') )
|
||||
return apply_filters('use_http_extension_transport', true);
|
||||
|
||||
return false;
|
||||
return apply_filters('use_http_extension_transport', function_exists('http_request'), $args );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1199,7 +1230,6 @@ class WP_Http_Curl {
|
|||
$proxy = new WP_HTTP_Proxy();
|
||||
|
||||
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
|
||||
curl_setopt( $handle, CURLOPT_HTTPPROXYTUNNEL, true );
|
||||
|
||||
$isPHP5 = version_compare(PHP_VERSION, '5.0.0', '>=');
|
||||
|
||||
|
@ -1219,10 +1249,17 @@ class WP_Http_Curl {
|
|||
}
|
||||
}
|
||||
|
||||
$is_local = isset($args['local']) && $args['local'];
|
||||
$ssl_verify = isset($args['sslverify']) && $args['sslverify'];
|
||||
if ( $is_local )
|
||||
$ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify);
|
||||
elseif ( ! $is_local )
|
||||
$ssl_verify = apply_filters('https_ssl_verify', $ssl_verify);
|
||||
|
||||
curl_setopt( $handle, CURLOPT_URL, $url);
|
||||
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
|
||||
curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, apply_filters('https_ssl_verify', $r['sslverify']) );
|
||||
curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, apply_filters('https_ssl_verify', $r['sslverify']) );
|
||||
curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, $ssl_verify );
|
||||
curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
|
||||
curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
|
||||
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $r['timeout'] );
|
||||
curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
|
||||
|
@ -1250,9 +1287,8 @@ class WP_Http_Curl {
|
|||
if ( !empty( $r['headers'] ) ) {
|
||||
// cURL expects full header strings in each element
|
||||
$headers = array();
|
||||
foreach ( $r['headers'] as $name => $value ) {
|
||||
foreach ( $r['headers'] as $name => $value )
|
||||
$headers[] = "{$name}: $value";
|
||||
}
|
||||
curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );
|
||||
}
|
||||
|
||||
|
@ -1317,7 +1353,7 @@ class WP_Http_Curl {
|
|||
*/
|
||||
function test($args = array()) {
|
||||
if ( function_exists('curl_init') && function_exists('curl_exec') )
|
||||
return apply_filters('use_curl_transport', true);
|
||||
return apply_filters('use_curl_transport', true, $args);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1338,14 +1374,14 @@ class WP_Http_Curl {
|
|||
* <li>WP_PROXY_PASSWORD - Proxy password, if it requires authentication.</li>
|
||||
* <li>WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy.
|
||||
* You do not need to have localhost and the blog host in this list, because they will not be passed
|
||||
* through the proxy.</li>
|
||||
* through the proxy. The list should be presented in a comma separated list</li>
|
||||
* </ol>
|
||||
*
|
||||
* An example can be as seen below.
|
||||
* <code>
|
||||
* define('WP_PROXY_HOST', '192.168.84.101');
|
||||
* define('WP_PROXY_PORT', '8080');
|
||||
* define('WP_PROXY_BYPASS_HOSTS', array('localhost', 'www.example.com'));
|
||||
* define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com');
|
||||
* </code>
|
||||
*
|
||||
* @link http://core.trac.wordpress.org/ticket/4011 Proxy support ticket in WordPress.
|
||||
|
@ -1353,14 +1389,6 @@ class WP_Http_Curl {
|
|||
*/
|
||||
class WP_HTTP_Proxy {
|
||||
|
||||
function WP_HTTP_Proxy() {
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether proxy connection should be used.
|
||||
*
|
||||
|
@ -1371,7 +1399,7 @@ class WP_HTTP_Proxy {
|
|||
* @return bool
|
||||
*/
|
||||
function is_enabled() {
|
||||
return ( defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT') );
|
||||
return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1384,7 +1412,7 @@ class WP_HTTP_Proxy {
|
|||
* @return bool
|
||||
*/
|
||||
function use_authentication() {
|
||||
return ( defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD') );
|
||||
return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1487,20 +1515,21 @@ class WP_HTTP_Proxy {
|
|||
if ( $check === false )
|
||||
return true;
|
||||
|
||||
$home = parse_url( get_bloginfo('site_url') );
|
||||
$home = parse_url( get_option('siteurl') );
|
||||
|
||||
if ( $uri == 'localhost' || $uri == $home['host'] )
|
||||
if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] )
|
||||
return false;
|
||||
|
||||
if ( defined('WP_PROXY_BYPASS_HOSTS') && is_array( WP_PROXY_BYPASS_HOSTS ) && in_array( $check['host'], WP_PROXY_BYPASS_HOSTS ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !defined('WP_PROXY_BYPASS_HOSTS') )
|
||||
return true;
|
||||
|
||||
static $bypass_hosts;
|
||||
if ( null == $bypass_hosts )
|
||||
$bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
|
||||
|
||||
return !in_array( $check['host'], $bypass_hosts );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Internal representation of a single cookie.
|
||||
*
|
||||
|
@ -1823,8 +1852,7 @@ class WP_Http_Encoding {
|
|||
* @return bool
|
||||
*/
|
||||
function is_available() {
|
||||
return ( function_exists('gzuncompress') || function_exists('gzdeflate') ||
|
||||
function_exists('gzinflate') );
|
||||
return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1890,7 +1918,6 @@ function wp_remote_request($url, $args = array()) {
|
|||
*/
|
||||
function wp_remote_get($url, $args = array()) {
|
||||
$objFetchSite = _wp_http_get_object();
|
||||
|
||||
return $objFetchSite->get($url, $args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue