diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 6c09db0740..1f767e1d4c 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -283,7 +283,7 @@ if ( !function_exists('wp_redirect') ) : function wp_redirect($location) { global $is_IIS; - $location = str_replace( array("\n", "\r"), '', $location); + $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $location); if ($is_IIS) header("Refresh: 0;url=$location");