Make sure every text in template is escaped by default (unless customCback returns unescaped value)
This commit is contained in:
parent
6f786583a9
commit
adff18f54d
|
@ -33,8 +33,9 @@ app.template = {
|
|||
for (var i = 0; i < matches.length; i++) {
|
||||
const k = matches[i];
|
||||
if (k.match(/^[a-zA-Z0-9_\.]+$/)) {
|
||||
var v = eval(`data.${k}`);
|
||||
if (customCback !== undefined) {
|
||||
var v = htmlescape(eval(`data.${k}`));
|
||||
if (v !== undefined &&
|
||||
customCback !== undefined) {
|
||||
var newv = customCback(k, v);
|
||||
if (newv !== undefined)
|
||||
v = newv;
|
||||
|
|
Loading…
Reference in New Issue