WordPress.org

Make WordPress Core

Ticket #17793: 17793.3.diff

File 17793.3.diff, 2.0 KB (added by MikeHansenMe, 5 years ago)
  • src/wp-admin/includes/user.php

     
    144144                $user->user_pass = $pass1;
    145145
    146146        if ( !$update && isset( $_POST['user_login'] ) && !validate_username( $_POST['user_login'] ) )
    147                 $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ));
     147                $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.  Usernames may contain only letters (a-z), numbers (0-9), dashes (-), underscores (_), and periods (.).' ) );
    148148
    149149        if ( !$update && username_exists( $user->user_login ) )
    150150                $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ));
  • src/wp-includes/user-functions.php

     
    19441944        if ( $sanitized_user_login == '' ) {
    19451945                $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
    19461946        } elseif ( ! validate_username( $user_login ) ) {
    1947                 $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     1947                $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.  Usernames may contain only letters (a-z), numbers (0-9), dashes (-), underscores (_), and periods (.).' ) );
    19481948                $sanitized_user_login = '';
    19491949        } elseif ( username_exists( $sanitized_user_login ) ) {
    19501950                $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );