diff options
author | zeripath <art27@cantab.net> | 2021-10-31 09:46:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-31 17:46:51 +0800 |
commit | 9340269d8433277807e98059bfb91daa8bc544b4 (patch) | |
tree | e6d98fe128be16f9a81466e67ff107c35d4d0717 | |
parent | 34650b925b09c432961c215b6bc80cefec14b339 (diff) | |
download | gitea-9340269d8433277807e98059bfb91daa8bc544b4.tar.gz gitea-9340269d8433277807e98059bfb91daa8bc544b4.zip |
Stop double encoding blame commit messages (#17498) (#17500)
Backport #17498
The call to html.EscapeString in routers/web/repo/blame.go:renderBlame is extraneous
as the commit message is now rendered by the template. The template will correctly
escape strings - therefore we are currently double escaping.
This PR fixes this.
Fix #17492
Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r-- | routers/web/repo/blame.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/web/repo/blame.go b/routers/web/repo/blame.go index 4ade9e9a93..69574111b2 100644 --- a/routers/web/repo/blame.go +++ b/routers/web/repo/blame.go @@ -7,7 +7,6 @@ package repo import ( "container/list" "fmt" - "html" gotemplate "html/template" "net/http" "strings" @@ -244,7 +243,7 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m br.PreviousSha = previousSha br.PreviousShaURL = fmt.Sprintf("%s/blame/commit/%s/%s", repoLink, previousSha, ctx.Repo.TreePath) br.CommitURL = fmt.Sprintf("%s/commit/%s", repoLink, part.Sha) - br.CommitMessage = html.EscapeString(commit.CommitMessage) + br.CommitMessage = commit.CommitMessage br.CommitSince = commitSince } |