adjust email validate
This commit is contained in:
@@ -72,7 +72,7 @@ module Params
|
|||||||
return if params[key].blank?
|
return if params[key].blank?
|
||||||
return if params[key].to_s.include?('<')
|
return if params[key].to_s.include?('<')
|
||||||
|
|
||||||
if params[key].to_s.strip.split(/\s*[;,]\s*/).compact_blank
|
if params[key].to_s.strip.split(%r{\s*[;,/]\s*}).compact_blank
|
||||||
.all? { |email| EmailTypo::DotCom.call(email).match?(EMAIL_REGEXP) || email.include?('--') }
|
.all? { |email| EmailTypo::DotCom.call(email).match?(EMAIL_REGEXP) || email.include?('--') }
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
+6
-4
@@ -118,15 +118,17 @@ module Submissions
|
|||||||
return if email.blank?
|
return if email.blank?
|
||||||
return if email.is_a?(Numeric)
|
return if email.is_a?(Numeric)
|
||||||
|
|
||||||
return email.downcase if email.to_s.include?(',') ||
|
email = email.to_s.tr('/', ',')
|
||||||
email.to_s.match?(/\.(?:gob|om|mm|cm|et|mo|nz|za|ie)\z/) ||
|
|
||||||
email.to_s.exclude?('.')
|
return email.downcase if email.include?(',') ||
|
||||||
|
email.match?(/\.(?:gob|om|mm|cm|et|mo|nz|za|ie)\z/) ||
|
||||||
|
email.exclude?('.')
|
||||||
|
|
||||||
fixed_email = EmailTypo.call(email.delete_prefix('<'))
|
fixed_email = EmailTypo.call(email.delete_prefix('<'))
|
||||||
|
|
||||||
return fixed_email if fixed_email == email
|
return fixed_email if fixed_email == email
|
||||||
|
|
||||||
domain = email.to_s.split('@').last.to_s.downcase
|
domain = email.split('@').last.to_s.downcase
|
||||||
fixed_domain = fixed_email.to_s.split('@').last
|
fixed_domain = fixed_email.to_s.split('@').last
|
||||||
|
|
||||||
return email.downcase if domain == fixed_domain
|
return email.downcase if domain == fixed_domain
|
||||||
|
|||||||
Reference in New Issue
Block a user