From: Toshi MARUYAMA Date: Sun, 22 Mar 2020 16:15:25 +0000 (+0000) Subject: scm: mercurial: change template "escape" to "urlescape" for "author" and "desc" ... X-Git-Tag: 4.2.0~1140 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=20ab5cb4dd8e856bed688d8d8e1cb2c1cd81312f;p=redmine.git scm: mercurial: change template "escape" to "urlescape" for "author" and "desc" (#23055) git-svn-id: http://svn.redmine.org/redmine/trunk@19606 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl b/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl index b5b4e9203..4c3af5340 100644 --- a/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl +++ b/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl @@ -1,7 +1,7 @@ changeset = 'This template must be used with --debug option\n' changeset_quiet = 'This template must be used with --debug option\n' changeset_verbose = 'This template must be used with --debug option\n' -changeset_debug = '\n{author|escape}\n{date|isodatesec}\n\n{file_mods}{file_adds}{file_dels}{file_copies}\n{desc|escape}\n\n{parents}\n\n\n' +changeset_debug = '\n{author|urlescape}\n{date|isodatesec}\n\n{file_mods}{file_adds}{file_dels}{file_copies}\n{desc|urlescape}\n\n{parents}\n\n\n' file_mod = '{file_mod|urlescape}\n' file_add = '{file_add|urlescape}\n' diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index f58021dde..81f23c14e 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -220,13 +220,15 @@ module Redmine yield Revision.new(:revision => le['revision'], :scmid => le['node'], :author => - (begin - le['author']['__content__'] - rescue - '' - end), + CGI.unescape( + (begin + le['author']['__content__'] + rescue + '' + end) + ), :time => Time.parse(le['date']['__content__']), - :message => le['msg']['__content__'], + :message => CGI.unescape(le['msg']['__content__']), :paths => paths, :parents => parents_ary) end