Skip to content

Commit fa0af49

Browse files
Gargronhiyuki2578
authored andcommitted
Fix encoding error when checking e-mail MX records (mastodon#11696)
1 parent 7a55c77 commit fa0af49

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/validators/email_mx_validator.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def invalid_mx?(value)
1414

1515
return true if domain.nil?
1616

17+
domain = TagManager.instance.normalize_domain(domain)
1718
hostnames = []
1819
ips = []
1920

@@ -29,6 +30,8 @@ def invalid_mx?(value)
2930
end
3031

3132
ips.empty? || on_blacklist?(hostnames + ips)
33+
rescue Addressable::URI::InvalidURIError
34+
true
3235
end
3336

3437
def on_blacklist?(values)

0 commit comments

Comments
 (0)