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.

Built from https://develop.svn.wordpress.org/trunk@33083


git-svn-id: http://core.svn.wordpress.org/trunk@33054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2015-07-04 05:53:24 +00:00
parent 67142f5a2f
commit eee4049c92
2 changed files with 5 additions and 1 deletions

View File

@ -494,6 +494,10 @@ function wpmu_validate_user_signup($user_name, $user_email) {
if ( strlen( $user_name ) < 4 ) if ( strlen( $user_name ) < 4 )
$errors->add('user_name', __( 'Username must be at least 4 characters.' ) ); $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 ) if ( strpos( $user_name, '_' ) !== false )
$errors->add( 'user_name', __( 'Sorry, usernames may not contain the character &#8220;_&#8221;!' ) ); $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character &#8220;_&#8221;!' ) );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta1-33082'; $wp_version = '4.3-beta1-33083';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.