Consolidate contiguous whitespace in usernames

git-svn-id: http://svn.automattic.com/wordpress/trunk@8704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-08-21 22:58:29 +00:00
parent 594b715207
commit 38dfd6e69a

View File

@ -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);
}