Fixed commit link title escaping (fixes #13405).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11671 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Etienne Massip 2013-03-21 21:53:28 +00:00
parent b26f1c55cc
commit d7cb14773b
3 changed files with 12 additions and 7 deletions

View File

@ -758,7 +758,7 @@ module ApplicationHelper
if repository && (changeset = Changeset.visible.where("repository_id = ? AND scmid LIKE ?", repository.id, "#{name}%").first)
link = link_to h("#{project_prefix}#{repo_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :repository_id => repository.identifier_param, :rev => changeset.identifier},
:class => 'changeset',
:title => truncate_single_line(h(changeset.comments), :length => 100)
:title => truncate_single_line(changeset.comments, :length => 100)
end
else
if repository && User.current.allowed_to?(:browse_repository, project)

View File

@ -13,6 +13,7 @@ changesets_002:
committed_on: 2007-04-12 15:14:44 +02:00
revision: 2
id: 101
scmid: 691322a8eb01e11fd7
comments: 'This commit fixes #1, #2 and references #1 & #3'
repository_id: 10
committer: dlopper

View File

@ -264,9 +264,12 @@ RAW
note_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
:class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
revision_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
:class => 'changeset', :title => 'My very first commit')
changeset_link2 = link_to('r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2},
revision_link2 = link_to('r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2},
:class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3')
changeset_link2 = link_to('691322a8eb01e11fd7', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2},
:class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3')
document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1},
@ -304,10 +307,11 @@ RAW
# should not ignore leading zero
'#03' => '#03',
# changesets
'r1' => changeset_link,
'r1.' => "#{changeset_link}.",
'r1, r2' => "#{changeset_link}, #{changeset_link2}",
'r1,r2' => "#{changeset_link},#{changeset_link2}",
'r1' => revision_link,
'r1.' => "#{revision_link}.",
'r1, r2' => "#{revision_link}, #{revision_link2}",
'r1,r2' => "#{revision_link},#{revision_link2}",
'commit:691322a8eb01e11fd7' => changeset_link2,
# documents
'document#1' => document_link,
'document:"Test document"' => document_link,