From d84c3d35f0b8b6159404759d07077debfb4a1249 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 24 May 2014 16:32:28 +0000 Subject: [PATCH] Merged r13106 (#16668). git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13157 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 1 + test/unit/helpers/application_helper_test.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index acb7ba9db..d564e838c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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) diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index e0abe026e..78de2ac78 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -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 "

#{link}

", textilizable('version:"Test & Show.txt"') + end + def test_link_to_issue_subject issue = Issue.generate!(:subject => "01234567890123456789") str = link_to_issue(issue, :truncate => 10) -- 2.39.5