0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-01 15:52:05 +01:00

Fix race condition in ReplaceSanitizer (#9123)

This commit is contained in:
zeripath 2019-11-22 14:46:39 +00:00 committed by GitHub
parent 30fde478db
commit 675f275237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,6 @@ func NewSanitizer() {
// ReplaceSanitizer replaces the current sanitizer to account for changes in settings
func ReplaceSanitizer() {
sanitizer = &Sanitizer{}
sanitizer.policy = bluemonday.UGCPolicy()
// We only want to allow HighlightJS specific classes for code blocks
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-\w+$`)).OnElements("code")