Redmine links not working with html escpaed characters (#16668).
git-svn-id: http://svn.redmine.org/redmine/trunk@13106 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d197203d79
commit
a4fa0364d4
|
@ -822,6 +822,7 @@ module ApplicationHelper
|
||||||
elsif sep == ':'
|
elsif sep == ':'
|
||||||
# removes the double quotes if any
|
# removes the double quotes if any
|
||||||
name = identifier.gsub(%r{^"(.*)"$}, "\\1")
|
name = identifier.gsub(%r{^"(.*)"$}, "\\1")
|
||||||
|
name = CGI.unescapeHTML(name)
|
||||||
case prefix
|
case prefix
|
||||||
when 'document'
|
when 'document'
|
||||||
if project && document = project.documents.visible.find_by_title(name)
|
if project && document = project.documents.visible.find_by_title(name)
|
||||||
|
|
|
@ -436,6 +436,14 @@ RAW
|
||||||
end
|
end
|
||||||
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
|
def test_link_to_issue_subject
|
||||||
issue = Issue.generate!(:subject => "01234567890123456789")
|
issue = Issue.generate!(:subject => "01234567890123456789")
|
||||||
str = link_to_issue(issue, :truncate => 10)
|
str = link_to_issue(issue, :truncate => 10)
|
||||||
|
|
Loading…
Reference in New Issue