Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77474ad

Browse files
committed
bugfix
1 parent 54dc982 commit 77474ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

websites/code2/studygolang/src/model/document.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package model
99
import (
1010
"db"
1111
"fmt"
12+
"html/template"
1213
"regexp"
1314
"strings"
1415
)
@@ -94,7 +95,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
9495
Title: objdoc.Title,
9596
Author: userLogin.Username,
9697
PubTime: objdoc.Ctime.String(),
97-
Content: objdoc.Content,
98+
Content: template.HTMLEscapeString(objdoc.Content),
9899
Tags: "",
99100
Viewnum: viewnum,
100101
Cmtnum: cmtnum,

0 commit comments

Comments
 (0)