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