mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-15 05:01:41 +08:00
Fix race condition in ReplaceSanitizer (#9123)
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user