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

Props Mte90.
Fixes #40542.


git-svn-id: https://develop.svn.wordpress.org/trunk@41257 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2017-08-16 21:10:39 +00:00
parent 1111c54b14
commit cbaa63caeb

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'];
}