Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Restore filename added to inline disposition

Oliver Güntherdbf46d084bc6
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 6720cd18514..0338f1de5dd 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -94,12 +94,12 @@ class Attachment < ApplicationRecord
end
def content_disposition(include_filename: true)
- return "inline" if inlineable?
+ disposition = inlineable? ? 'inline' : 'attachment'
if include_filename
- "attachment; filename=#{attachment.filename}"
+ "#{disposition}; filename=#{filename}"
else
- "attachment"
+ disposition
end
end