|
@@ -451,13 +451,12 @@ func (this *ReportController) Add() {
|
|
|
br.ErrMsg = "存在非法标签, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- content, e := services.FilterReportContentBr(req.Content)
|
|
|
+ req.Content, e = services.FilterReportContentBr(req.Content)
|
|
|
if e != nil {
|
|
|
br.Msg = "内容去除前后空格失败"
|
|
|
br.ErrMsg = "内容去除前后空格失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- req.Content = content
|
|
|
|
|
|
contentSub, err = services.GetReportContentSub(req.Content)
|
|
|
if err != nil {
|
|
@@ -897,35 +896,33 @@ func (this *ReportController) SaveReportContent() {
|
|
|
|
|
|
// 内容有过修改的话,那么逻辑处理
|
|
|
if noChangeFlag != 1 {
|
|
|
- content := req.Content
|
|
|
- if content == "" {
|
|
|
- content = this.GetString("Content")
|
|
|
+ if req.Content == "" {
|
|
|
+ req.Content = this.GetString("Content")
|
|
|
}
|
|
|
- content = services.HandleReportContent(content, "del", nil)
|
|
|
+ req.Content = services.HandleReportContent(req.Content, "del", nil)
|
|
|
|
|
|
- if content != "" {
|
|
|
+ if req.Content != "" {
|
|
|
e := utils.ContentXssCheck(req.Content)
|
|
|
if e != nil {
|
|
|
br.Msg = "存在非法标签"
|
|
|
br.ErrMsg = "存在非法标签, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- contentClean, e := services.FilterReportContentBr(req.Content)
|
|
|
+ req.Content, e = services.FilterReportContentBr(req.Content)
|
|
|
if e != nil {
|
|
|
br.Msg = "内容去除前后空格失败"
|
|
|
br.ErrMsg = "内容去除前后空格失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- content = contentClean
|
|
|
|
|
|
req.ContentStruct = services.HandleReportContentStruct(req.ContentStruct, "del", nil)
|
|
|
|
|
|
- contentSub, err := services.GetReportContentSub(content)
|
|
|
+ contentSub, err := services.GetReportContentSub(req.Content)
|
|
|
if err != nil {
|
|
|
go alarm_msg.SendAlarmMsg("解析 ContentSub 失败,Err:"+err.Error(), 3)
|
|
|
//utils.SendEmail(utils.APPNAME+"失败提醒", "解析 ContentSub 失败,Err:"+err.Error(), utils.EmailSendToUsers)
|
|
|
}
|
|
|
- reportInfo.Content = html.EscapeString(content)
|
|
|
+ reportInfo.Content = html.EscapeString(req.Content)
|
|
|
reportInfo.ContentSub = html.EscapeString(contentSub)
|
|
|
reportInfo.ContentStruct = html.EscapeString(req.ContentStruct)
|
|
|
reportInfo.HeadImg = req.HeadImg
|