Consolidate contiguous whitespace in usernames
git-svn-id: https://develop.svn.wordpress.org/trunk@8704 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7404c72fde
commit
519072ea9f
@ -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…
x
Reference in New Issue
Block a user