diff options
author | Unknwon <u@gogs.io> | 2017-03-31 16:19:10 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-31 16:19:10 -0400 |
commit | 761bb3cf53960485921ad045bae5a79340d66f97 (patch) | |
tree | 7f8e475e64cbd9ba6f485891092478cba028c96c /routers | |
parent | c1c269d9ef50595475cf4c6728d9b20a6417c490 (diff) |
modules/markup: protect sanitizer from possible modification
Only expose public APIs for 'Sanitize' and 'SanitizeBytes' to
eliminate unintentional modifications to sanitizer policy. Also
use 'sync.Once' to make sure multiple calls of 'NewSanitizer' is
safe (although should never happen, but this is a better way).
Diffstat (limited to 'routers')
-rw-r--r-- | routers/install.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/install.go b/routers/install.go index 2e6bee10..9d9bb6d1 100644 --- a/routers/install.go +++ b/routers/install.go @@ -62,7 +62,7 @@ func GlobalInit() { if setting.InstallLock { highlight.NewContext() - markup.BuildSanitizer() + markup.NewSanitizer() if err := models.NewEngine(); err != nil { log.Fatal(2, "Fail to initialize ORM engine: %v", err) } |