mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: don't put attachments on the CDN when 'prevent anons from downloading files' is enabled
This commit is contained in:
@ -308,8 +308,8 @@ class CookedPostProcessor
|
||||
end
|
||||
|
||||
def optimize_urls
|
||||
# when login is required, attachments can't be on the CDN
|
||||
if SiteSetting.login_required
|
||||
# attachments can't be on the CDN when either setting is enabled
|
||||
if SiteSetting.login_required || SiteSetting.prevent_anons_from_downloading_files
|
||||
@doc.css("a.attachment[href]").each do |a|
|
||||
href = a["href"].to_s
|
||||
a["href"] = UrlHelper.schemaless UrlHelper.absolute_without_cdn(href) if UrlHelper.is_local(href)
|
||||
|
Reference in New Issue
Block a user