Merge pull request #1491 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
This commit is contained in:
@@ -22,7 +22,7 @@ class BlacklistedEmailValidator < ActiveModel::Validator
|
||||
domains = Rails.configuration.x.email_domains_blacklist.gsub('.', '\.')
|
||||
regexp = Regexp.new("@(.+\\.)?(#{domains})", true)
|
||||
|
||||
@email =~ regexp
|
||||
regexp.match?(@email)
|
||||
end
|
||||
|
||||
def not_on_whitelist?
|
||||
|
@@ -15,6 +15,6 @@ class HtmlValidator < ActiveModel::EachValidator
|
||||
|
||||
def html_errors(str)
|
||||
fragment = Nokogiri::HTML.fragment(options[:wrap_with] ? "<#{options[:wrap_with]}>#{str}</#{options[:wrap_with]}>" : str)
|
||||
fragment.errors.select { |error| ERROR_RE =~ error.message }
|
||||
fragment.errors.select { |error| ERROR_RE.match?(error.message) }
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user