HTTP: Avoid an undefined index notice in wp_http_validate_url()
.
Props perezlabs. Fixes #34164. git-svn-id: https://develop.svn.wordpress.org/trunk@36870 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b723d3fb75
commit
92bdac8474
@ -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'], '.' );
|
||||
|
Loading…
Reference in New Issue
Block a user