From c73a812109e1a64ecf21b6a198f949c58d1f2674 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 6 Mar 2016 15:55:26 +0000 Subject: [PATCH] HTTP: Avoid an undefined index notice in `wp_http_validate_url()`. Props perezlabs. Fixes #34164. Built from https://develop.svn.wordpress.org/trunk@36870 git-svn-id: http://core.svn.wordpress.org/trunk@36837 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/http.php | 6 +++++- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 9bb554a0e6..05792c29c2 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -523,7 +523,11 @@ function wp_http_validate_url( $url ) { $parsed_home = @parse_url( get_option( 'home' ) ); - $same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ); + if ( isset( $parsed_home['host'] ) ) { + $same_host = ( strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ) || 'localhost' === strtolower( $parsed_url['host'] ) ); + } else { + $same_host = false; + } if ( ! $same_host ) { $host = trim( $parsed_url['host'], '.' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ec9baa5f24..08a2b015b5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta2-36869'; +$wp_version = '4.5-beta2-36870'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.