Ticket #33101: 33101-3.patch
| File 33101-3.patch, 1.7 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/includes/user.php
125 125 */ 126 126 do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) ); 127 127 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 140 128 /* Check for "\" in password */ 141 129 if ( false !== strpos( wp_unslash( $pass1 ), "\\" ) ) 142 130 $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); … … 143 131 144 132 /* checking the password has been typed twice the same */ 145 133 if ( $pass1 != $pass2 ) 146 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the twopassword 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' ) ); 147 135 148 136 if ( !empty( $pass1 ) ) 149 137 $user->user_pass = $pass1;