use chars as opposed to split
This commit is contained in:
parent
5346cd3514
commit
dacfdd4dc8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue