summaryrefslogtreecommitdiffstats
path: root/core/js/octemplate.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/octemplate.js')
-rw-r--r--core/js/octemplate.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/js/octemplate.js b/core/js/octemplate.js
index e69c6cc56e0..46ffa976574 100644
--- a/core/js/octemplate.js
+++ b/core/js/octemplate.js
@@ -60,9 +60,10 @@
var self = this;
if(typeof this.options.escapeFunction === 'function') {
- for (var key = 0; key < this.vars.length; key++) {
- if(typeof this.vars[key] === 'string') {
- this.vars[key] = self.options.escapeFunction(this.vars[key]);
+ var keys = Object.keys(this.vars);
+ for (var key = 0; key < keys.length; key++) {
+ if(typeof this.vars[keys[key]] === 'string') {
+ this.vars[keys[key]] = self.options.escapeFunction(this.vars[keys[key]]);
}
}
}
@@ -85,7 +86,7 @@
}
},
options: {
- escapeFunction: function(str) {return $('<i></i>').text(str).html();}
+ escapeFunction: escapeHTML
}
};