From fa960874a3a5111b3054515e7c9893e4d8333f24 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Fri, 22 Nov 2019 12:30:28 +0000 Subject: [PATCH] Fix race condition in ReplaceSanitizer --- modules/markup/sanitizer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go index f873e8105e659..45d363b37ee3a 100644 --- a/modules/markup/sanitizer.go +++ b/modules/markup/sanitizer.go @@ -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")