diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 777dfbef1f..2f302539e9 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1396,6 +1396,14 @@ if ( ! function_exists( 'wp_validate_redirect' ) ) : return $default; } + if ( ! isset( $lp['host'] ) && ! empty( $lp['path'] ) && '/' !== $lp['path'][0] ) { + $path = ''; + if ( ! empty( $_SERVER['REQUEST_URI'] ) ) { + $path = dirname( parse_url( 'http://placeholder' . $_SERVER['REQUEST_URI'], PHP_URL_PATH ) . '?' ); + } + $location = '/' . ltrim( $path . '/', '/' ) . $location; + } + // Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field. if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { return $default; diff --git a/wp-includes/version.php b/wp-includes/version.php index ecf589b6fb..d9db12dc14 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2.3-RC1-45938'; +$wp_version = '5.2.3-RC1-45972'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.