]> source.dussan.org Git - gitea.git/commitdiff
Clusterfuzz found another way (#15160)
authorzeripath <art27@cantab.net>
Thu, 25 Mar 2021 23:21:00 +0000 (23:21 +0000)
committerGitHub <noreply@github.com>
Thu, 25 Mar 2021 23:21:00 +0000 (01:21 +0200)
Clusterfuzz found another way so I found another way to stop it

Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/markup/html.go

index 2ea0b56f727880a7148243941fc4011a861674e3..bec9ba2fb49f613cf824635f4b7b1ff197a8f670 100644 (file)
@@ -313,7 +313,7 @@ func RenderEmoji(
        return ctx.postProcess(rawHTML)
 }
 
-var tagCleaner = regexp.MustCompile(`<((?:/?\w+/\w+)|(?:/[\w ]+/)|(/?[hH][tT][mM][lL][ />])|(/?[hH][eE][aA][dD][ />]))`)
+var tagCleaner = regexp.MustCompile(`<((?:/?\w+/\w+)|(?:/[\w ]+/)|(/?[hH][tT][mM][lL]\b)|(/?[hH][eE][aA][dD]\b))`)
 var nulCleaner = strings.NewReplacer("\000", "")
 
 func (ctx *postProcessCtx) postProcess(rawHTML []byte) ([]byte, error) {