Make WordPress Core


Ignore:
Timestamp:
10/14/2019 11:03:34 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Formatting: In wp_validate_redirect(), normalize the path when validating the location for relative URLs, to account for Windows paths.

Props peterwilsoncc, rconde, jmmathc, mat-lipe, Sixes, justinahinon, cmagrin, daxelrod, SergeyBiryukov.
Merges [46472] to the 5.2 branch.
Fixes #47980.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-includes/pluggable.php

    r45972 r46473  
    14011401            if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
    14021402                $path = dirname( parse_url( 'http://placeholder' . $_SERVER['REQUEST_URI'], PHP_URL_PATH ) . '?' );
     1403                $path = wp_normalize_path( $path );
    14031404            }
    14041405            $location = '/' . ltrim( $path . '/', '/' ) . $location;
Note: See TracChangeset for help on using the changeset viewer.