mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-04-05 20:17:53 +08:00
feat:移除危险HTML标签
This commit is contained in:
parent
f1957dd9c0
commit
37fe31797d
@ -7,6 +7,8 @@ import (
|
||||
"github.com/astaxie/beego"
|
||||
"errors"
|
||||
"github.com/lifei6671/mindoc/utils/cryptil"
|
||||
"github.com/lifei6671/mindoc/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//项目空间
|
||||
@ -76,6 +78,10 @@ func (item *Itemsets) Exist(itemId int) bool {
|
||||
//保存
|
||||
func (item *Itemsets) Save() (err error) {
|
||||
|
||||
item.ItemName = strings.TrimSpace(utils.StripTags(item.ItemName))
|
||||
item.Description = strings.TrimSpace(utils.StripTags(item.Description))
|
||||
item.ItemKey = strings.TrimSpace(item.ItemKey)
|
||||
|
||||
if item.ItemName == "" {
|
||||
return errors.New("项目空间名称不能为空")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user