Make WordPress Core


Ignore:
Timestamp:
07/04/2015 05:52:46 AM (10 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r32950 r33083  
    494494    if ( strlen( $user_name ) < 4 )
    495495        $errors->add('user_name',  __( 'Username must be at least 4 characters.' ) );
     496
     497    if ( strlen( $user_name ) > 60 ) {
     498        $errors->add( 'user_name', __( 'Username may not be longer than 60 characters.' ) );
     499    }
    496500
    497501    if ( strpos( $user_name, '_' ) !== false )
Note: See TracChangeset for help on using the changeset viewer.