Permalink
Browse files

Consolidate contiguous whitespace in usernames . For 2.6

git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 073cfc3 commit 4a4183df4f687aeaa067545959599603da2bebc3 ryan committed Aug 27, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 wp-includes/formatting.php
@@ -332,6 +332,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);
}

0 comments on commit 4a4183d

Please sign in to comment.