2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: validates attachments against current authorized extensions

This commit is contained in:
Régis Hanol 2017-11-07 19:17:33 +01:00
parent 4f0bdec370
commit be0c7609f1
3 changed files with 35 additions and 1 deletions

View file

@ -635,7 +635,7 @@ module Email
# create the upload for the user
opts = { for_group_message: options[:is_group_message] }
upload = UploadCreator.new(tmp, attachment.filename, opts).create_for(user_id)
if upload && upload.errors.empty?
if upload&.valid?
# try to inline images
if attachment.content_type&.start_with?("image/")
if raw[attachment.url]