]> source.dussan.org Git - gitea.git/commitdiff
Fix race condition in ReplaceSanitizer (#9123)
authorzeripath <art27@cantab.net>
Fri, 22 Nov 2019 14:46:39 +0000 (14:46 +0000)
committerGitHub <noreply@github.com>
Fri, 22 Nov 2019 14:46:39 +0000 (14:46 +0000)
modules/markup/sanitizer.go

index f873e8105e659c93674eb60cdf2493dc19ed9eaa..45d363b37ee3a1bcb3b9ec265680d740bbcb1e01 100644 (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")