Make WordPress Core


Ignore:
Timestamp:
08/16/2017 09:10:39 PM (9 years ago)
Author:
DrewAPicture
Message:

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

Props Mte90.
Fixes #40542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/canonical.php

    r41003 r41257  
    569569                        $url .= ':' . $parsed_url['port'];
    570570                }
    571                 $url .= $parsed_url['path'];
     571
     572                if ( ! empty( $parsed_url['path'] ) ) {
     573                        $url .= $parsed_url['path'];
     574                }
     575
    572576                if ( ! empty( $parsed_url['query'] ) ) {
    573577                        $url .= '?' . $parsed_url['query'];
Note: See TracChangeset for help on using the changeset viewer.