aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-10-31 08:25:24 +0000
committerGitHub <noreply@github.com>2021-10-31 10:25:24 +0200
commit4e8a81780ed4ff0423e3a2ac7f75265e362ca46d (patch)
treead3f90cd997d16955dcf379727aef1902b5af600
parent1ff944f6982b939e81b8da2425e8680f6fd8fc77 (diff)
downloadgitea-4e8a81780ed4ff0423e3a2ac7f75265e362ca46d.tar.gz
gitea-4e8a81780ed4ff0423e3a2ac7f75265e362ca46d.zip
Stop double encoding blame commit messages (#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.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/web/repo/blame.go b/routers/web/repo/blame.go
index c2da8e9cdc..3632d1846e 100644
--- a/routers/web/repo/blame.go
+++ b/routers/web/repo/blame.go
@@ -6,7 +6,6 @@ package repo
import (
"fmt"
- "html"
gotemplate "html/template"
"net/http"
"strings"
@@ -239,7 +238,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
}