diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 47bdafd395..fb44dc35d5 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1215,6 +1215,7 @@ if ( ! function_exists( 'wp_redirect' ) ) : * * @since 1.5.1 * @since 5.1.0 The `$x_redirect_by` parameter was added. + * @since 5.4.0 On invalid status codes, wp_die() is called. * * @global bool $is_IIS * @@ -1250,6 +1251,10 @@ if ( ! function_exists( 'wp_redirect' ) ) : return false; } + if ( 300 > $status || 399 < $status ) { + wp_die( __( 'HTTP redirect status code must be a redirection code, 3xx.' ) ); + } + $location = wp_sanitize_redirect( $location ); if ( ! $is_IIS && PHP_SAPI != 'cgi-fcgi' ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 5b0d0db53a..9ae1be41fc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46640'; +$wp_version = '5.4-alpha-46641'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.