From 761bb3cf53960485921ad045bae5a79340d66f97 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 31 Mar 2017 16:19:10 -0400 Subject: 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). --- modules/markup/markdown_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/markup/markdown_test.go') diff --git a/modules/markup/markdown_test.go b/modules/markup/markdown_test.go index 2d06a149..cbf75312 100644 --- a/modules/markup/markdown_test.go +++ b/modules/markup/markdown_test.go @@ -1,13 +1,14 @@ package markup_test import ( - . "github.com/gogits/gogs/modules/markup" - . "github.com/smartystreets/goconvey/convey" + "bytes" "testing" - "bytes" - "github.com/gogits/gogs/modules/setting" "github.com/russross/blackfriday" + . "github.com/smartystreets/goconvey/convey" + + . "github.com/gogits/gogs/modules/markup" + "github.com/gogits/gogs/modules/setting" ) func TestMarkdown(t *testing.T) { -- cgit v1.2.3