mirror of
https://github.com/kikobar/mastodon.git
synced 2024-12-25 15:24:14 +00:00
Fix encoding error when checking e-mail MX records (#11696)
This commit is contained in:
parent
14996496a5
commit
bfca58d137
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue