From b8f70a27a52e6a2c8021485bfc1522eb5071c39f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 19 Feb 2017 19:18:06 +0800 Subject: [PATCH] Security: fix XSS attack on alert (#973) --- templates/base/alert.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl index 8d05b882a7..61b99486e2 100644 --- a/templates/base/alert.tmpl +++ b/templates/base/alert.tmpl @@ -1,15 +1,15 @@ {{if .Flash.ErrorMsg}}
-

{{.Flash.ErrorMsg | Safe}}

+

{{.Flash.ErrorMsg | Str2html}}

{{end}} {{if .Flash.SuccessMsg}}
-

{{.Flash.SuccessMsg | Safe}}

+

{{.Flash.SuccessMsg | Str2html}}

{{end}} {{if .Flash.InfoMsg}}
-

{{.Flash.InfoMsg | Safe}}

+

{{.Flash.InfoMsg | Str2html}}

{{end}}