File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module github.com/feiin/go-xss
22
33go 1.12
44
5- require github.com/feiin/pkg v0.0.0-20200516102027-5ac181da46b6
5+ require github.com/feiin/pkg v0.2.1
Original file line number Diff line number Diff line change 11github.com/feiin/pkg v0.0.0-20200516102027-5ac181da46b6 h1:yNgjO67CSASFT/dD06ZtNuTO5mC8NOxq8X8qOPcaNpE =
22github.com/feiin/pkg v0.0.0-20200516102027-5ac181da46b6 /go.mod h1:5c1e9ZJud6jYkdjVOwYgNweJcDuFxkh2xiBek0w+hg8 =
3+ github.com/feiin/pkg v0.2.1 h1:fqewu0DwUvMHq50jxdQcUumfQ5JjZy4DyH/jfp6JzhI =
4+ github.com/feiin/pkg v0.2.1 /go.mod h1:a+eNap+KldbxTPdyChieaQ+z8EUr5h3eXnDliCngMP4 =
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ type Xss struct {
1212 options XssOption
1313}
1414
15- //NewXSS
15+ // NewXSS
1616func NewXSS (options XssOption ) * Xss {
1717
1818 defaultOption := NewDefaultXssOption ()
@@ -82,7 +82,7 @@ func GetAttrs(html string) AttrResult {
8282
8383}
8484
85- //Process 处理xss
85+ // Process 处理xss
8686func (x * Xss ) Process (html string ) string {
8787
8888 if len (html ) < 3 {
@@ -153,7 +153,7 @@ func (x *Xss) Process(html string) string {
153153 }
154154
155155 attrsHTML := parseAttr (attrs .Html , func (name , value string ) string {
156- isWhiteAttr := arrays .ContainsString (whiteAttrList , name ) != - 1
156+ isWhiteAttr := arrays .Contains (whiteAttrList , name ) != - 1
157157
158158 ret := onTagAttr (tag , name , value , isWhiteAttr )
159159
@@ -211,7 +211,7 @@ func (x *Xss) Process(html string) string {
211211 return retHTML
212212}
213213
214- //FilterXSS filter xss func
214+ // FilterXSS filter xss func
215215func FilterXSS (html string , options XssOption ) string {
216216 xss := NewXSS (options )
217217 return xss .Process (html )
You can’t perform that action at this time.
0 commit comments