Canonical: Check first before attempting to include a 'path' value in the URL in `strip_fragment_from_url()`.

Props Mte90.
Fixes #40542.

Built from https://develop.svn.wordpress.org/trunk@41257


git-svn-id: http://core.svn.wordpress.org/trunk@41097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2017-08-16 21:11:43 +00:00
parent ea92bb5f10
commit e80cf1d861
2 changed files with 6 additions and 2 deletions

View File

@ -568,7 +568,11 @@ function strip_fragment_from_url( $url ) {
if ( ! empty( $parsed_url['port'] ) ) {
$url .= ':' . $parsed_url['port'];
}
$url .= $parsed_url['path'];
if ( ! empty( $parsed_url['path'] ) ) {
$url .= $parsed_url['path'];
}
if ( ! empty( $parsed_url['query'] ) ) {
$url .= '?' . $parsed_url['query'];
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41256';
$wp_version = '4.9-alpha-41257';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.