diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 6386c95f62..775f2a11fc 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1280,6 +1280,9 @@ if ( ! function_exists( 'wp_sanitize_redirect' ) ) : * @return string Redirect-sanitized URL. */ function wp_sanitize_redirect( $location ) { + // Encode spaces. + $location = str_replace( ' ', '%20', $location ); + $regex = '/ ( (?: [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx @@ -1296,7 +1299,7 @@ if ( ! function_exists( 'wp_sanitize_redirect' ) ) : $location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location ); $location = wp_kses_no_null( $location ); - // remove %0d and %0a from location + // Remove %0D and %0A from location. $strip = array( '%0d', '%0a', '%0D', '%0A' ); return _deep_replace( $strip, $location ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9b02e63fb0..61fb8497a8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-beta3-46461'; +$wp_version = '5.3-beta3-46462'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.