mirror of
https://gitee.com/layui/layui.git
synced 2025-10-07 23:24:32 +08:00
添加 latpl 应用安全提示注释
This commit is contained in:
@@ -98,6 +98,8 @@ compile.render(data, callback); // 模板渲染
|
||||
{{- d.include("/laytpl/detail/options.md") }}
|
||||
</div>
|
||||
|
||||
> ### 注意
|
||||
> 开发者在使用模板语法时,需确保模板中的 JS 语句不来自于页面用户输入,即必须在页面开发者自身的可控范围内,否则请避免使用该模板引擎。
|
||||
|
||||
<h2 id="config" lay-toc="{level: 2}">属性配置</h2>
|
||||
|
||||
|
@@ -118,6 +118,10 @@ layui.define(function(exports){
|
||||
template = '"use strict";var view = "' + template + '";return view;';
|
||||
|
||||
try {
|
||||
/**
|
||||
* 请注意: 开发者在使用模板语法时,需确保模板中的 JS 语句不来自于页面用户输入。
|
||||
* 即模板中的 JS 语句必须在页面开发者自身的可控范围内,否则请避免使用该模板解析。
|
||||
*/
|
||||
that.cache = template = new Function('d, laytpl', template);
|
||||
return template(data, tool);
|
||||
} catch(e) {
|
||||
|
Reference in New Issue
Block a user