Skip to content

Commit

Permalink
Fix encoding error when checking e-mail MX records (#11696)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed Aug 29, 2019
1 parent 1499649 commit bfca58d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/validators/email_mx_validator.rb
Expand Up @@ -14,6 +14,7 @@ def invalid_mx?(value)

return true if domain.nil?

domain = TagManager.instance.normalize_domain(domain)
hostnames = []
ips = []

Expand All @@ -29,6 +30,8 @@ def invalid_mx?(value)
end

ips.empty? || on_blacklist?(hostnames + ips)
rescue Addressable::URI::InvalidURIError
true
end

def on_blacklist?(values)
Expand Down

0 comments on commit bfca58d

Please sign in to comment.