From 38dfd6e69a7121de0cc65be21406b5eaf125ecc9 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 21 Aug 2008 22:58:29 +0000 Subject: [PATCH] Consolidate contiguous whitespace in usernames git-svn-id: http://svn.automattic.com/wordpress/trunk@8704 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 7c1839fa92..d55a6bd538 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -447,6 +447,9 @@ function sanitize_user( $username, $strict = false ) { if ( $strict ) $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); + // Consolidate contiguous whitespace + $username = preg_replace('|\s+|', ' ', $username); + return apply_filters('sanitize_user', $username, $raw_username, $strict); }