aboutsummaryrefslogtreecommitdiff
path: root/pkg/template
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-09-28 23:56:45 -0400
committerUnknwon <u@gogs.io>2018-09-28 23:56:45 -0400
commit0d66b1cc1c8c44c041f5274f967535d62bd371e1 (patch)
tree2d1cc270322f9a03768da18e55f12e65ec7a2511 /pkg/template
parent1843354d88b4998a93fc0165ccca760977be3e73 (diff)
pkg/context: apply EscapePound at context level
Always escape template variable {{.Link}} variable and redirect calls. Relates to #5442
Diffstat (limited to 'pkg/template')
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/template/template.go b/pkg/template/template.go
index ff9921e7..8a85980a 100644
--- a/pkg/template/template.go
+++ b/pkg/template/template.go
@@ -64,7 +64,7 @@ func NewFuncMap() []template.FuncMap {
"AppendAvatarSize": tool.AppendAvatarSize,
"Safe": Safe,
"Sanitize": bluemonday.UGCPolicy().Sanitize,
- "Str2html": Str2html,
+ "Str2html": Str2HTML,
"NewLine2br": NewLine2br,
"TimeSince": tool.TimeSince,
"RawTimeSince": tool.RawTimeSince,
@@ -127,7 +127,7 @@ func Safe(raw string) template.HTML {
return template.HTML(raw)
}
-func Str2html(raw string) template.HTML {
+func Str2HTML(raw string) template.HTML {
return template.HTML(markup.Sanitize(raw))
}