Make WordPress Core

Ticket #47003: 47003.diff

File 47003.diff, 2.3 KB (added by chetan200891, 5 years ago)

Refreshed patch.

  • src/wp-includes/ms-functions.php

    diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php
    index 0b4e453c3b..29268d96a9 100644
    a b function wpmu_validate_user_signup( $user_name, $user_email ) { 
    473473        $user_name     = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
    474474
    475475        if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {
    476                 $errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers.' ) );
     476                $errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ) );
    477477                $user_name = $orig_username;
    478478        }
    479479
  • src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
    index 83979c2891..6de51c91a5 100644
    a b class WP_REST_Users_Controller extends WP_REST_Controller { 
    12461246                if ( ! validate_username( $username ) ) {
    12471247                        return new WP_Error(
    12481248                                'rest_user_invalid_username',
    1249                                 __( 'Username contains invalid characters.' ),
     1249                                __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ),
    12501250                                array( 'status' => 400 )
    12511251                        );
    12521252                }
  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index 1838a71d73..2567fc8bfa 100644
    a b function register_new_user( $user_login, $user_email ) { 
    24962496        if ( '' == $sanitized_user_login ) {
    24972497                $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
    24982498        } elseif ( ! validate_username( $user_login ) ) {
    2499                 $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     2499                $errors->add( 'invalid_username', __( '<strong>Error</strong>: Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ) );
    25002500                $sanitized_user_login = '';
    25012501        } elseif ( username_exists( $sanitized_user_login ) ) {
    25022502                $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );