fix(tree): 修复编辑节点标题时的 xss 问题 (#1845)
This commit is contained in:
parent
54e35f2204
commit
0e31264812
@ -551,7 +551,7 @@ layui.define(['form','util'], function(exports){
|
||||
elemMain.children('.layui-tree-editInput').val(util.unescape(text)).focus();
|
||||
// 嵌入文字移除输入框
|
||||
var getVal = function(input){
|
||||
var textNew = input.val().trim();
|
||||
var textNew = util.escape(input.val().trim());
|
||||
textNew = textNew ? textNew : options.text.defaultNodeName;
|
||||
input.remove();
|
||||
elemMain.children('.'+ ELEM_TEXT).html(textNew);
|
||||
@ -862,4 +862,4 @@ layui.define(['form','util'], function(exports){
|
||||
};
|
||||
|
||||
exports(MOD_NAME, tree);
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user