Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[User Accounts] Fix edge-case that gave a confusing error message #5956

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/user_accounts/php/edit_user.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,14 @@ class Edit_User extends \NDB_Form
//==================================
// Password validation
//==================================
if ($values['Email'] === $values['Password_hash']) {

// Make sure the user is not using their email address as their password.
// Do not show this error if the password is an empty string: in this
// case, that means the email is empty also. It's more appropriate to
// display only the error 'You must enter an email'.
if ($values['Email'] === $values['Password_hash']
&& $values['Password_hash'] !== ''
) {
$errors['Password_Group'] = self::PASSWORD_ERROR_IS_EMAIL;
}
if (!is_null($this->identifier)) {
Expand Down