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