Make WordPress Core


Ignore:
Timestamp:
10/10/2015 01:21:30 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Users: Remove redundant error message when password is only entered once.

"Please enter the same password in both password fields" should cover all the scenarios.

Props MikeHansenMe, jmayhak, desrosj, gounder.
Fixes #33101.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/user.php

    r34534 r35008  
    126126        do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) );
    127127
    128         if ( $update ) {
    129                 if ( empty($pass1) && !empty($pass2) )
    130                         $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) );
    131                 elseif ( !empty($pass1) && empty($pass2) )
    132                         $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) );
    133         } else {
    134                 if ( empty($pass1) )
    135                         $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) );
    136                 elseif ( empty($pass2) )
    137                         $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) );
    138         }
    139 
    140128        /* Check for "\" in password */
    141129        if ( false !== strpos( wp_unslash( $pass1 ), "\\" ) )
     
    144132        /* checking the password has been typed twice the same */
    145133        if ( $pass1 != $pass2 )
    146                 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );
     134                $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
    147135
    148136        if ( !empty( $pass1 ) )
Note: See TracChangeset for help on using the changeset viewer.