mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 09:09:36 -05:00
Fix race condition in ReplaceSanitizer (#9123)
This commit is contained in:
parent
30fde478db
commit
675f275237
1 changed files with 0 additions and 1 deletions
|
@ -34,7 +34,6 @@ func NewSanitizer() {
|
||||||
|
|
||||||
// ReplaceSanitizer replaces the current sanitizer to account for changes in settings
|
// ReplaceSanitizer replaces the current sanitizer to account for changes in settings
|
||||||
func ReplaceSanitizer() {
|
func ReplaceSanitizer() {
|
||||||
sanitizer = &Sanitizer{}
|
|
||||||
sanitizer.policy = bluemonday.UGCPolicy()
|
sanitizer.policy = bluemonday.UGCPolicy()
|
||||||
// We only want to allow HighlightJS specific classes for code blocks
|
// We only want to allow HighlightJS specific classes for code blocks
|
||||||
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-\w+$`)).OnElements("code")
|
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-\w+$`)).OnElements("code")
|
||||||
|
|
Loading…
Reference in a new issue