]> cat aescling's git repositories - mastodon.git/commitdiff
Fix encoding error when checking e-mail MX records (#11696)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 29 Aug 2019 23:35:12 +0000 (01:35 +0200)
committerGitHub <noreply@github.com>
Thu, 29 Aug 2019 23:35:12 +0000 (01:35 +0200)
app/validators/email_mx_validator.rb

index 96fbedcfcf9b813dccba10d44238a3b1f6226ddd..9b5009966833ac391ce42e631e836aefd7e43525 100644 (file)
@@ -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)