Ticket #47003: 47003.2.patch
File 47003.2.patch, 2.3 KB (added by , 6 years ago) |
---|
-
wp-includes/ms-functions.php
451 451 $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); 452 452 453 453 if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) { 454 $errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers .' ) );454 $errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ) ); 455 455 $user_name = $orig_username; 456 456 } 457 457 -
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
1130 1130 $username = (string) $value; 1131 1131 1132 1132 if ( ! validate_username( $username ) ) { 1133 return new WP_Error( 'rest_user_invalid_username', __( 'Username contains invalid characters.' ), array( 'status' => 400 ) );1133 return new WP_Error( 'rest_user_invalid_username', __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ), array( 'status' => 400 ) ); 1134 1134 } 1135 1135 1136 1136 /** This filter is documented in wp-includes/user.php */ -
wp-includes/user.php
2437 2437 if ( $sanitized_user_login == '' ) { 2438 2438 $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) ); 2439 2439 } elseif ( ! validate_username( $user_login ) ) { 2440 $errors->add( 'invalid_username', __( ' <strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );2440 $errors->add( 'invalid_username', __( 'Usernames can only contain lowercase letters (a-z) and numbers (0-9).' ) ); 2441 2441 $sanitized_user_login = ''; 2442 2442 } elseif ( username_exists( $sanitized_user_login ) ) { 2443 2443 $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );