diff --git a/backend/app/store/comment.go b/backend/app/store/comment.go index 0c0e0fc6..80de8bfe 100644 --- a/backend/app/store/comment.go +++ b/backend/app/store/comment.go @@ -153,8 +153,8 @@ func (c *Comment) Snippet(limit int) string { var reHref = regexp.MustCompile(`]*?\s+)?href="([^"]*)"`) -// wrap with href to trigger bluemonday sanitizer -// clean href after sanitizing done +// SanitizeAsURL drops dangerous code from a url. +// It wraps input with href to trigger bluemonday sanitizer and cleans href after sanitizing done func (c *Comment) SanitizeAsURL(inp string) string { h := fmt.Sprintf(``, inp) clean := bluemonday.UGCPolicy().Sanitize(h)