FIX: Change secure media to encompass attachments as well (#9271)

If the “secure media” site setting is enabled then ALL files uploaded to Discourse (images, video, audio, pdf, txt, zip etc. etc.) will follow the secure media rules. The “prevent anons from downloading files” setting will no longer have any bearing on upload security. Basically, the feature will more appropriately be called “secure uploads” instead of “secure media”.

This is being done because there are communities out there that would like all attachments and media to be secure based on category rules but still allow anonymous users to download attachments in public places, which is not possible in the current arrangement.
This commit is contained in:
Martin Brennan
2020-03-26 07:16:02 +10:00
committed by GitHub
parent 4fa580fbd1
commit 097851c135
16 changed files with 106 additions and 127 deletions

View File

@@ -379,9 +379,8 @@ class PostCreator
end
def update_uploads_secure_status
if SiteSetting.secure_media? || SiteSetting.prevent_anons_from_downloading_files?
@post.update_uploads_secure_status
end
return if !SiteSetting.secure_media?
@post.update_uploads_secure_status
end
def handle_spam