diff options
Diffstat (limited to 'app/helpers/domain_control_helper.rb')
-rw-r--r-- | app/helpers/domain_control_helper.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/helpers/domain_control_helper.rb b/app/helpers/domain_control_helper.rb index ac60cad29..cd51a8b7e 100644 --- a/app/helpers/domain_control_helper.rb +++ b/app/helpers/domain_control_helper.rb @@ -12,14 +12,12 @@ module DomainControlHelper end end - if whitelist_mode? - !DomainAllow.allowed?(domain) - else - DomainBlock.blocked?(domain) - end + domain != Rails.configuration.x.local_domain && (!DomainAllow.allowed?(domain) || DomainBlock.blocked?(domain)) + rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError + nil end def whitelist_mode? - Rails.configuration.x.whitelist_mode + !(Rails.env.development? || Rails.env.test?) end end |