From c83ea95120703ea6f9bf38a9093590662205b62b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 14 Oct 2019 11:04:55 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/5.2@46473 git-svn-id: http://core.svn.wordpress.org/branches/5.2@46271 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 2f302539e9..254570a17c 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1400,6 +1400,7 @@ if ( ! function_exists( 'wp_validate_redirect' ) ) : $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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0800d11e45..30c227058c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2.4-alpha-46406'; +$wp_version = '5.2.4-alpha-46473'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.