mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Usernames in multisite should be restricted to 60 characters or fewer.
Only 60 characters can be stored in the database for a username, which could cause lookup issues when attempting to use similar usernames of extreme length. Props @DJPaul. See #17904, Fixes #26784. git-svn-id: https://develop.svn.wordpress.org/trunk@33083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -494,6 +494,10 @@ function wpmu_validate_user_signup($user_name, $user_email) {
|
||||
if ( strlen( $user_name ) < 4 )
|
||||
$errors->add('user_name', __( 'Username must be at least 4 characters.' ) );
|
||||
|
||||
if ( strlen( $user_name ) > 60 ) {
|
||||
$errors->add( 'user_name', __( 'Username may not be longer than 60 characters.' ) );
|
||||
}
|
||||
|
||||
if ( strpos( $user_name, '_' ) !== false )
|
||||
$errors->add( 'user_name', __( 'Sorry, usernames may not contain the character “_”!' ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user