1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-12 05:27:20 +00:00

Improve some sanitizer rules (#32534)

This is a backport-only fix for 1.22

1.23 has a proper fix #32533
This commit is contained in:
wxiaoguang
2024-11-18 11:42:30 +08:00
committed by GitHub
parent 6555cfcac3
commit 578c02d652
3 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ const (
// SanitizerRules implements markup.Renderer
func (Renderer) SanitizerRules() []setting.MarkupSanitizerRule {
return []setting.MarkupSanitizerRule{
{Element: "div", AllowAttr: "class", Regexp: regexp.MustCompile(playerClassName)},
{Element: "div", AllowAttr: "class", Regexp: regexp.MustCompile("^" + playerClassName + "$")},
{Element: "div", AllowAttr: playerSrcAttr},
}
}