Skip to content

Commit

Permalink
Fix encoding error when checking e-mail MX records (mastodon#11696)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent 7a55c77 commit fa0af49
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 fa0af49

Please sign in to comment.