FIX: use allowlist and blocklist terminology (#10209)

This is a PR of the renaming whitelist to allowlist and blacklist to the blocklist.
This commit is contained in:
Krzysztof Kotlarek
2020-07-27 10:23:54 +10:00
committed by GitHub
parent 5077cf52fd
commit e0d9232259
130 changed files with 676 additions and 570 deletions

View File

@ -292,8 +292,8 @@ module Oneboxer
end
end
def self.blacklisted_domains
SiteSetting.onebox_domains_blacklist.split("|")
def self.blocked_domains
SiteSetting.blocked_onebox_domains.split("|")
end
def self.preserve_fragment_url_hosts
@ -304,12 +304,12 @@ module Oneboxer
Discourse.cache.fetch(onebox_cache_key(url), expires_in: 1.day) do
fd = FinalDestination.new(url,
ignore_redirects: ignore_redirects,
ignore_hostnames: blacklisted_domains,
ignore_hostnames: blocked_domains,
force_get_hosts: force_get_hosts,
force_custom_user_agent_hosts: force_custom_user_agent_hosts,
preserve_fragment_url_hosts: preserve_fragment_url_hosts)
uri = fd.resolve
return blank_onebox if uri.blank? || blacklisted_domains.map { |hostname| uri.hostname.match?(hostname) }.any?
return blank_onebox if uri.blank? || blocked_domains.map { |hostname| uri.hostname.match?(hostname) }.any?
options = {
max_width: 695,