diff options
author | Reverite <github@reverite.sh> | 2019-07-20 18:46:40 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-07-20 18:46:40 -0700 |
commit | 266540080ef5659060faa7da502123f45bbc04f2 (patch) | |
tree | 1c34751dd4e199737b7a2a4c511b756760941c52 /app/helpers/domain_control_helper.rb | |
parent | 40fd56351f0a466e0e3785cca4ee27f2a9060e8a (diff) | |
parent | f1597e1ab90b1fb291f16977877c6ca79bf89676 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/helpers/domain_control_helper.rb')
-rw-r--r-- | app/helpers/domain_control_helper.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/helpers/domain_control_helper.rb b/app/helpers/domain_control_helper.rb new file mode 100644 index 000000000..efd328f81 --- /dev/null +++ b/app/helpers/domain_control_helper.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module DomainControlHelper + def domain_not_allowed?(uri_or_domain) + return if uri_or_domain.blank? + + domain = begin + if uri_or_domain.include?('://') + Addressable::URI.parse(uri_or_domain).domain + else + uri_or_domain + end + end + + DomainBlock.blocked?(domain) + end +end |