I can see validate_user() calls sanitize_user() with strict argument as true, which means uppercase letters are not allowed too.

In source code, I found this comment

// If strict, reduce to ASCII for max portability.
    if ( $strict )
        $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );

I would like to know how does this affect portability?

3 s
3

Uppercase characters are not blocked in usernames on single site setups.

Uppercase characters ARE blocked in usernames on multisite setups. The wpmu_validate_user_signup function forces lowercase a-z and numbers 0-9 only.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *