mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
594b715207
commit
38dfd6e69a
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user