mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
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:

committed by
GitHub

parent
5077cf52fd
commit
e0d9232259
@ -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,
|
||||
|
Reference in New Issue
Block a user