Skip to content
Permalink
Browse files

Formatting: In `wp_validate_redirect()`, normalize the path when vali…

…dating the location for relative URLs, to account for Windows paths.

Props peterwilsoncc, rconde, jmmathc, mat-lipe, Sixes, justinahinon, cmagrin, daxelrod, SergeyBiryukov.
Fixes #47980.
Built from https://develop.svn.wordpress.org/trunk@46472


git-svn-id: http://core.svn.wordpress.org/trunk@46270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
SergeyBiryukov committed Oct 14, 2019
1 parent e8fcc3f commit 9db44754b9e4044690a6c32fd74b9d5fe26b07b2
Showing with 2 additions and 1 deletion.
  1. +1 −0 wp-includes/pluggable.php
  2. +1 −1 wp-includes/version.php
@@ -1418,6 +1418,7 @@ function wp_validate_redirect( $location, $default = '' ) {
$path = '';
if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
$path = dirname( parse_url( 'http://placeholder' . $_SERVER['REQUEST_URI'], PHP_URL_PATH ) . '?' );
$path = wp_normalize_path( $path );
}
$location = '/' . ltrim( $path . '/', '/' ) . $location;
}
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-beta3-46471';
$wp_version = '5.3-beta3-46472';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 comments on commit 9db4475

Please sign in to comment.
You can’t perform that action at this time.