mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Post#each_upload_url yields incorrect path to block when CDN is enabled.
This commit is contained in:
@@ -905,7 +905,7 @@ class Post < ActiveRecord::Base
|
||||
next unless Discourse.store.has_been_uploaded?(src) || (include_local_upload && src =~ /\A\/[^\/]/i)
|
||||
|
||||
path = begin
|
||||
URI(URI.unescape(src))&.path
|
||||
URI(URI.unescape(GlobalSetting.cdn_url ? src.sub(GlobalSetting.cdn_url, "") : src))&.path
|
||||
rescue URI::Error
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user