diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 76fbd0847a..6ed0a5c24d 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -274,7 +274,7 @@ function sanitize_user( $username, $strict = false ) { // If strict, reduce to ASCII for max portability. if ( $strict ) - $username = preg_replace('|[^a-z0-9 _.-@]|i', '', $username); + $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); return apply_filters('sanitize_user', $username, $raw_username, $strict); }