use chars as opposed to split

This commit is contained in:
Sam 2017-02-14 09:40:15 -05:00
parent 5346cd3514
commit dacfdd4dc8
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class PasswordValidator < ActiveModel::EachValidator
record.errors.add(attribute, :same_as_current)
elsif SiteSetting.block_common_passwords && CommonPasswords.common_password?(value)
record.errors.add(attribute, :common)
elsif value.split("").uniq.length < SiteSetting.password_unique_characters
elsif value.chars.uniq.length < SiteSetting.password_unique_characters
record.errors.add(attribute, :unique_characters)
end
end