1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-09 09:01:31 +00:00

"thumbnail" macro may break filename attribute of the attachment (#29038).

Patch by Toru Takahashi.


git-svn-id: http://svn.redmine.org/redmine/trunk@17428 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2018-07-02 02:36:22 +00:00
parent ef864bed28
commit 51fdc31e1c
2 changed files with 2 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class Attachment < ActiveRecord::Base
end
def title
title = filename.to_s
title = filename.dup
if description.present?
title << " (#{description})"
end

View File

@ -258,6 +258,7 @@ class AttachmentTest < ActiveSupport::TestCase
a = Attachment.new(:filename => "test.png", :description => "Cool image")
assert_equal "test.png (Cool image)", a.title
assert_equal "test.png", a.filename
end
def test_new_attachment_should_be_editable_by_author