Fix encoding error when checking e-mail MX records (#11696)

pull/1209/head
Eugen Rochko 2019-08-30 01:35:12 +02:00 committed by GitHub
parent 14996496a5
commit bfca58d137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class EmailMxValidator < ActiveModel::Validator
return true if domain.nil? return true if domain.nil?
domain = TagManager.instance.normalize_domain(domain)
hostnames = [] hostnames = []
ips = [] ips = []
@ -29,6 +30,8 @@ class EmailMxValidator < ActiveModel::Validator
end end
ips.empty? || on_blacklist?(hostnames + ips) ips.empty? || on_blacklist?(hostnames + ips)
rescue Addressable::URI::InvalidURIError
true
end end
def on_blacklist?(values) def on_blacklist?(values)