From: Eugen Rochko Date: Thu, 29 Aug 2019 23:35:12 +0000 (+0200) Subject: Fix encoding error when checking e-mail MX records (#11696) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=bfca58d1371f8aa9840c9ca84bcc6de1503f863c;p=mastodon.git Fix encoding error when checking e-mail MX records (#11696) --- diff --git a/app/validators/email_mx_validator.rb b/app/validators/email_mx_validator.rb index 96fbedcfc..9b5009966 100644 --- a/app/validators/email_mx_validator.rb +++ b/app/validators/email_mx_validator.rb @@ -14,6 +14,7 @@ class EmailMxValidator < ActiveModel::Validator return true if domain.nil? + domain = TagManager.instance.normalize_domain(domain) hostnames = [] ips = [] @@ -29,6 +30,8 @@ class EmailMxValidator < ActiveModel::Validator end ips.empty? || on_blacklist?(hostnames + ips) + rescue Addressable::URI::InvalidURIError + true end def on_blacklist?(values)