diff options
| author | 2024-07-08 07:34:39 +0000 | |
|---|---|---|
| committer | 2024-07-08 07:34:39 +0000 | |
| commit | 5769722c583474d9ea3e346a7773261738245268 (patch) | |
| tree | 91f35f10c92ac85092857e7c618a8a2377dd11fe /vendor/github.com/microcosm-cc/bluemonday/sanitize.go | |
| parent | [chore]: Bump golang.org/x/crypto from 0.24.0 to 0.25.0 (#3080) (diff) | |
| download | gotosocial-5769722c583474d9ea3e346a7773261738245268.tar.xz | |
[chore]: Bump github.com/microcosm-cc/bluemonday from 1.0.26 to 1.0.27 (#3081)
Diffstat (limited to 'vendor/github.com/microcosm-cc/bluemonday/sanitize.go')
| -rw-r--r-- | vendor/github.com/microcosm-cc/bluemonday/sanitize.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go index 1f8d85526..47c31f7da 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go +++ b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go @@ -529,9 +529,11 @@ attrsLoop: if ap.regexp != nil { if ap.regexp.MatchString(htmlAttr.Val) { cleanAttrs = append(cleanAttrs, htmlAttr) + continue attrsLoop } } else { cleanAttrs = append(cleanAttrs, htmlAttr) + continue attrsLoop } } } @@ -762,10 +764,10 @@ attrsLoop: switch elementName { case "audio", "img", "link", "script", "video": var crossOriginFound bool - for _, htmlAttr := range cleanAttrs { + for i, htmlAttr := range cleanAttrs { if htmlAttr.Key == "crossorigin" { crossOriginFound = true - htmlAttr.Val = "anonymous" + cleanAttrs[i].Val = "anonymous" } } @@ -1087,3 +1089,8 @@ func normaliseElementName(str string) string { `"`, ) } + +type stringWriterWriter interface { + io.Writer + io.StringWriter +} |
