2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: incorrect logic in email blocker

if mail.com was blocked, email.com was automatically blocked
This commit is contained in:
Sam 2015-06-15 11:28:50 +10:00
parent 04288c14ff
commit 69ad0358c2
2 changed files with 20 additions and 8 deletions

View file

@ -17,7 +17,7 @@ class EmailValidator < ActiveModel::EachValidator
def email_in_restriction_setting?(setting, value)
domains = setting.gsub('.', '\.')
regexp = Regexp.new("@(.+\.)?(#{domains})", true)
regexp = Regexp.new("@(.+\\.)?(#{domains})", true)
value =~ regexp
end