]> source.dussan.org Git - redmine.git/commitdiff
Merged r13106 (#16668).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 24 May 2014 16:32:28 +0000 (16:32 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 24 May 2014 16:32:28 +0000 (16:32 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13157 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/unit/helpers/application_helper_test.rb

index acb7ba9db877f4f066f06f3bf55a64179e70f2fc..d564e838c0d9dff612987b17271e8a5fef148996 100644 (file)
@@ -819,6 +819,7 @@ module ApplicationHelper
         elsif sep == ':'
           # removes the double quotes if any
           name = identifier.gsub(%r{^"(.*)"$}, "\\1")
+          name = CGI.unescapeHTML(name)
           case prefix
           when 'document'
             if project && document = project.documents.visible.find_by_title(name)
index e0abe026e6cdc64cd2c31382eb8e40b33dc3d3e0..78de2ac7820a6ab765eb1e526a2efb6f73a5c5b7 100644 (file)
@@ -436,6 +436,14 @@ RAW
     end
   end
 
+  def test_redmine_links_by_name_should_work_with_html_escaped_characters
+    v = Version.generate!(:name => "Test & Show.txt", :project_id => 1)
+    link = link_to("Test & Show.txt", "/versions/#{v.id}", :class => "version")
+
+    @project = v.project
+    assert_equal "<p>#{link}</p>", textilizable('version:"Test & Show.txt"')
+  end
+
   def test_link_to_issue_subject
     issue = Issue.generate!(:subject => "01234567890123456789")
     str = link_to_issue(issue, :truncate => 10)