Security: prevent XSS attach on wiki page
Reported by Miguel Ángel Jimeno.
This commit is contained in:
parent
43c94d0a6c
commit
134f3e6e09
2 changed files with 8 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue