Merge tag 'v4.1.0'

This commit is contained in:
bgme 2023-02-12 20:23:07 +08:00
commit ff7bfaaef2
981 changed files with 53076 additions and 19360 deletions

View file

@ -10,6 +10,8 @@ class EmailMxValidator < ActiveModel::Validator
if domain.blank?
user.errors.add(:email, :invalid)
elsif domain.include?('..')
user.errors.add(:email, :invalid)
elsif !on_allowlist?(domain)
resolved_ips, resolved_domains = resolve_mx(domain)

View file

@ -10,5 +10,7 @@ class URLValidator < ActiveModel::EachValidator
def compliant?(url)
parsed_url = Addressable::URI.parse(url)
parsed_url && %w(http https).include?(parsed_url.scheme) && parsed_url.host
rescue Addressable::URI::InvalidURIError
false
end
end