mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00:00
Security: prevent XSS attach on wiki page
Reported by Miguel Ángel Jimeno.
This commit is contained in:
committed by
Kim "BKC" Carlbäcker
parent
43c94d0a6c
commit
134f3e6e09
@ -15,6 +15,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
"golang.org/x/net/html/charset"
|
||||
"golang.org/x/text/transform"
|
||||
"gopkg.in/editorconfig/editorconfig-core-go.v1"
|
||||
@ -61,6 +62,7 @@ func NewFuncMap() []template.FuncMap {
|
||||
},
|
||||
"AvatarLink": base.AvatarLink,
|
||||
"Safe": Safe,
|
||||
"Sanitize": bluemonday.UGCPolicy().Sanitize,
|
||||
"Str2html": Str2html,
|
||||
"TimeSince": base.TimeSince,
|
||||
"RawTimeSince": base.RawTimeSince,
|
||||
|
Reference in New Issue
Block a user