From ba5803c16ea0ed9d0eb6071fcb17ff417d81440f Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 30 Aug 2016 17:15:54 +0000 Subject: [PATCH] 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 --- src/wp-includes/http.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/http.php b/src/wp-includes/http.php index fe7c841325..c1dd390c82 100644 --- a/src/wp-includes/http.php +++ b/src/wp-includes/http.php @@ -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; }