##// END OF EJS Templates
Redmine links not working with html escpaed characters (#16668)....
Jean-Philippe Lang -
r12831:a4fa0364d459
parent child
Show More
@@ -822,6 +822,7 module ApplicationHelper
822 elsif sep == ':'
822 elsif sep == ':'
823 # removes the double quotes if any
823 # removes the double quotes if any
824 name = identifier.gsub(%r{^"(.*)"$}, "\\1")
824 name = identifier.gsub(%r{^"(.*)"$}, "\\1")
825 name = CGI.unescapeHTML(name)
825 case prefix
826 case prefix
826 when 'document'
827 when 'document'
827 if project && document = project.documents.visible.find_by_title(name)
828 if project && document = project.documents.visible.find_by_title(name)
@@ -436,6 +436,14 RAW
436 end
436 end
437 end
437 end
438
438
439 def test_redmine_links_by_name_should_work_with_html_escaped_characters
440 v = Version.generate!(:name => "Test & Show.txt", :project_id => 1)
441 link = link_to("Test & Show.txt", "/versions/#{v.id}", :class => "version")
442
443 @project = v.project
444 assert_equal "<p>#{link}</p>", textilizable('version:"Test & Show.txt"')
445 end
446
439 def test_link_to_issue_subject
447 def test_link_to_issue_subject
440 issue = Issue.generate!(:subject => "01234567890123456789")
448 issue = Issue.generate!(:subject => "01234567890123456789")
441 str = link_to_issue(issue, :truncate => 10)
449 str = link_to_issue(issue, :truncate => 10)
General Comments 0
You need to be logged in to leave comments. Login now