HTTP API: Prevent a fatal error on PHP < 5.4.7 due to changes introduced in [38449].

Fixes #36356


git-svn-id: https://develop.svn.wordpress.org/trunk@38450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2016-08-30 17:15:54 +00:00
parent 48f389015e
commit ba5803c16e
1 changed files with 4 additions and 2 deletions

View File

@ -659,8 +659,10 @@ function wp_parse_url( $url, $component = -1 ) {
if ( ! $parts = @parse_url( 'placeholder://placeholder' . $url, $component ) ) {
return $parts;
}
// Remove the placeholder values
unset( $parts['scheme'], $parts['host'] );
if ( is_array( $parts ) ) {
// Remove the placeholder values
unset( $parts['scheme'], $parts['host'] );
}
} else {
return $parts;
}