From a5c1f545c4f64e930c44bacaa04312941ac94dc7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 10 Oct 2015 13:22:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@35008 git-svn-id: http://core.svn.wordpress.org/trunk@34973 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/user.php | 14 +------------- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index a0444397b3..54a66ffcbc 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -125,25 +125,13 @@ function edit_user( $user_id = 0 ) { */ do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) ); - if ( $update ) { - if ( empty($pass1) && !empty($pass2) ) - $errors->add( 'pass', __( 'ERROR: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) ); - elseif ( !empty($pass1) && empty($pass2) ) - $errors->add( 'pass', __( 'ERROR: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) ); - } else { - if ( empty($pass1) ) - $errors->add( 'pass', __( 'ERROR: Please enter your password.' ), array( 'form-field' => 'pass1' ) ); - elseif ( empty($pass2) ) - $errors->add( 'pass', __( 'ERROR: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) ); - } - /* Check for "\" in password */ if ( false !== strpos( wp_unslash( $pass1 ), "\\" ) ) $errors->add( 'pass', __( 'ERROR: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); /* checking the password has been typed twice the same */ if ( $pass1 != $pass2 ) - $errors->add( 'pass', __( 'ERROR: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) ); + $errors->add( 'pass', __( 'ERROR: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) ); if ( !empty( $pass1 ) ) $user->user_pass = $pass1; diff --git a/wp-includes/version.php b/wp-includes/version.php index 97077c0fe3..d4b8521666 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35007'; +$wp_version = '4.4-alpha-35008'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.