Commit 512dc23b authored by maeda's avatar maeda

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

Patch by Toru Takahashi.


git-svn-id: https://svn.redmine.org/redmine/trunk@17428 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d561820a
......@@ -155,7 +155,7 @@ class Attachment < ActiveRecord::Base
end
def title
title = filename.to_s
title = filename.dup
if description.present?
title << " (#{description})"
end
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment