Make WordPress Core

Changeset 29661


Ignore:
Timestamp:
09/02/2014 02:05:48 AM (10 years ago)
Author:
SergeyBiryukov
Message:

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

props markoheijnen.
fixes #29392.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r29479 r29661  
    202202        // Determine if this request is to OUR install of WordPress.
    203203        $homeURL = parse_url( get_bloginfo( 'url' ) );
    204         if ( isset( $homeURL['host'] ) ) {
    205             $r['local'] = ( $homeURL['host'] == $arrURL['host'] || 'localhost' == $arrURL['host'] );
    206         } else {
    207             $r['local'] = false;
    208         }
     204        $r['local'] = 'localhost' == $arrURL['host'] || ( isset( $homeURL['host'] ) && $homeURL['host'] == $arrURL['host'] );
    209205        unset( $homeURL );
    210206
     
    638634
    639635        // Don't block requests back to ourselves by default.
    640         if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) {
     636        if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) ) {
    641637            /**
    642638             * Filter whether to block local requests through the proxy.
     
    17331729            return $result;
    17341730
    1735         if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] )
     1731        if ( 'localhost' == $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) )
    17361732            return false;
    17371733
Note: See TracChangeset for help on using the changeset viewer.