Avoid PHP notices when checking for local requests in in WP_Http.

props markoheijnen.
fixes #29392.

git-svn-id: https://develop.svn.wordpress.org/trunk@29661 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-09-02 02:05:48 +00:00
parent 4e846f9af7
commit cac2366382
1 changed files with 3 additions and 7 deletions

View File

@ -201,11 +201,7 @@ class WP_Http {
// Determine if this request is to OUR install of WordPress.
$homeURL = parse_url( get_bloginfo( 'url' ) );
if ( isset( $homeURL['host'] ) ) {
$r['local'] = ( $homeURL['host'] == $arrURL['host'] || 'localhost' == $arrURL['host'] );
} else {
$r['local'] = false;
}
$r['local'] = 'localhost' == $arrURL['host'] || ( isset( $homeURL['host'] ) && $homeURL['host'] == $arrURL['host'] );
unset( $homeURL );
/*
@ -637,7 +633,7 @@ class WP_Http {
$home = parse_url( get_option('siteurl') );
// Don't block requests back to ourselves by default.
if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) {
if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) ) {
/**
* Filter whether to block local requests through the proxy.
*
@ -1732,7 +1728,7 @@ class WP_HTTP_Proxy {
if ( ! is_null( $result ) )
return $result;
if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] )
if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) )
return false;
if ( !defined('WP_PROXY_BYPASS_HOSTS') )