Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider bfca58d1 rédigé par Eugen Rochko's avatar Eugen Rochko Validation de GitHub
Parcourir les fichiers

Fix encoding error when checking e-mail MX records (#11696)

parent 14996496
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -14,6 +14,7 @@ class EmailMxValidator < ActiveModel::Validator ...@@ -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 ...@@ -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)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter