domain_control_helper.rb 341 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. module DomainControlHelper
  3. def domain_not_allowed?(uri_or_domain)
  4. return if uri_or_domain.blank?
  5. domain = begin
  6. if uri_or_domain.include?('://')
  7. Addressable::URI.parse(uri_or_domain).domain
  8. else
  9. uri_or_domain
  10. end
  11. end
  12. DomainBlock.blocked?(domain)
  13. end
  14. end