Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

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 abcang committed Sep 30, 2019
1 parent cc6b548 commit 3e50d26
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 3e50d26

Please sign in to comment.