mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:14:12 +08:00
Allow theme field object model to support uploads
This commit is contained in:
@ -7,6 +7,13 @@ module GlobalPath
|
||||
"#{GlobalSetting.cdn_url}#{path(p)}"
|
||||
end
|
||||
|
||||
def upload_cdn_path(p)
|
||||
if SiteSetting.s3_cdn_url.present?
|
||||
p = p.sub(Discourse.store.absolute_base_url, SiteSetting.s3_cdn_url)
|
||||
end
|
||||
p =~ /^http/ ? p : cdn_path(p)
|
||||
end
|
||||
|
||||
def cdn_relative_path(path)
|
||||
if (cdn_url = GlobalSetting.cdn_url).present?
|
||||
URI.parse(cdn_url).path + path
|
||||
|
Reference in New Issue
Block a user