WordPress.org

Make WordPress Core

Ticket #17793: 17793.diff

File 17793.diff, 1.9 KB (added by solarissmoke, 21 months ago)
  • wp-login.php

     
    298298        if ( $sanitized_user_login == '' ) { 
    299299                $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) ); 
    300300        } elseif ( ! validate_username( $user_login ) ) { 
    301                 $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); 
     301                $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 (.).' ) ); 
    302302                $sanitized_user_login = ''; 
    303303        } elseif ( username_exists( $sanitized_user_login ) ) { 
    304304                $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered, please choose another one.' ) ); 
  • wp-admin/includes/user.php

     
    161161                $user->user_pass = $pass1; 
    162162 
    163163        if ( !$update && isset( $_POST['user_login'] ) && !validate_username( $_POST['user_login'] ) ) 
    164                 $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' )); 
     164                $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 (.).' )); 
    165165 
    166166        if ( !$update && username_exists( $user->user_login ) ) 
    167167                $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ));