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 ) { |
473 | 473 | $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); |
474 | 474 | |
475 | 475 | 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).' ) ); |
477 | 477 | $user_name = $orig_username; |
478 | 478 | } |
479 | 479 | |
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 { |
1246 | 1246 | if ( ! validate_username( $username ) ) { |
1247 | 1247 | return new WP_Error( |
1248 | 1248 | 'rest_user_invalid_username', |
1249 | | __( 'Username contains invalid characters.' ), |
| 1249 | __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ), |
1250 | 1250 | array( 'status' => 400 ) |
1251 | 1251 | ); |
1252 | 1252 | } |
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 ) { |
2496 | 2496 | if ( '' == $sanitized_user_login ) { |
2497 | 2497 | $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) ); |
2498 | 2498 | } 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).' ) ); |
2500 | 2500 | $sanitized_user_login = ''; |
2501 | 2501 | } elseif ( username_exists( $sanitized_user_login ) ) { |
2502 | 2502 | $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) ); |