Make WordPress Core

Ticket #47003: 47003.2.patch

File 47003.2.patch, 2.3 KB (added by ramiy, 6 years ago)

another 3 similar strings merged into 1 string

  • wp-includes/ms-functions.php

     
    451451        $user_name     = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
    452452
    453453        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).' ) );
    455455                $user_name = $orig_username;
    456456        }
    457457
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

     
    11301130                $username = (string) $value;
    11311131
    11321132                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 ) );
    11341134                }
    11351135
    11361136                /** This filter is documented in wp-includes/user.php */
  • wp-includes/user.php

     
    24372437        if ( $sanitized_user_login == '' ) {
    24382438                $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
    24392439        } 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).' ) );
    24412441                $sanitized_user_login = '';
    24422442        } elseif ( username_exists( $sanitized_user_login ) ) {
    24432443                $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );