From 53fb84baa3bbb03ca2de7b126b77016960860c90 Mon Sep 17 00:00:00 2001 From: bgr11n Date: Tue, 5 Jan 2016 22:43:11 +0200 Subject: [PATCH] fixed password validator on equality with email --- lib/validators/password_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validators/password_validator.rb b/lib/validators/password_validator.rb index cb7cb457e..015f08f12 100644 --- a/lib/validators/password_validator.rb +++ b/lib/validators/password_validator.rb @@ -10,7 +10,7 @@ class PasswordValidator < ActiveModel::EachValidator record.errors.add(attribute, :too_short, count: SiteSetting.min_password_length) elsif record.username.present? && value == record.username record.errors.add(attribute, :same_as_username) - elsif record.username.present? && value == record.email + elsif record.email.present? && value == record.email record.errors.add(attribute, :same_as_email) elsif SiteSetting.block_common_passwords && CommonPasswords.common_password?(value) record.errors.add(attribute, :common)