Make WordPress Core

Changeset 36870


Ignore:
Timestamp:
03/06/2016 03:54:13 PM (9 years ago)
Author:
swissspidy
Message:

HTTP: Avoid an undefined index notice in wp_http_validate_url().

Props perezlabs.
Fixes #34164.

File:
1 edited

Legend:

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

    r36435 r36870  
    524524    $parsed_home = @parse_url( get_option( 'home' ) );
    525525
    526     $same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );
     526    if ( isset( $parsed_home['host'] ) ) {
     527        $same_host = ( strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ) || 'localhost' === strtolower( $parsed_url['host'] ) );
     528    } else {
     529        $same_host = false;
     530    }
    527531
    528532    if ( ! $same_host ) {
Note: See TracChangeset for help on using the changeset viewer.