Ticket #47003: 47003.4.diff
File 47003.4.diff, 2.1 KB (added by , 4 years ago) |
---|
-
src/wp-includes/ms-functions.php
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 -
src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
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 } -
src/wp-includes/user.php
2513 2513 if ( '' === $sanitized_user_login ) { 2514 2514 $errors->add( 'empty_username', __( 'Please enter a username.' ) ); 2515 2515 } elseif ( ! validate_username( $user_login ) ) { 2516 $errors->add( 'invalid_username', __( ' This username is invalid because it uses illegal characters. Please enter a valid username.' ) );2516 $errors->add( 'invalid_username', __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ) ); 2517 2517 $sanitized_user_login = ''; 2518 2518 } elseif ( username_exists( $sanitized_user_login ) ) { 2519 2519 $errors->add( 'username_exists', __( 'This username is already registered. Please choose another one.' ) );