From 34c5b51cf095ddff2f38c44920ecdf428a6fb0b8 2017-01-29 08:03:26 From: Jean-Philippe Lang Date: 2017-01-29 08:03:26 Subject: [PATCH] Always send images user-uploaded images with Content-Disposition: attachment (#24199). Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@16285 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index ad0b1e4..4412435 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -219,7 +219,7 @@ class AttachmentsController < ApplicationController end def disposition(attachment) - if attachment.is_image? || attachment.is_pdf? + if attachment.is_pdf? 'inline' else 'attachment' diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index b073d8c..eeb2bce 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -430,7 +430,7 @@ class RepositoriesController < ApplicationController end def disposition(path) - if Redmine::MimeType.is_type?('image', @path) || Redmine::MimeType.of(@path) == "application/pdf" + if Redmine::MimeType.of(@path) == "application/pdf" 'inline' else 'attachment'