summaryrefslogtreecommitdiffstats
path: root/core/js/octemplate.js
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-08-14 23:06:43 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-08-14 23:06:43 +0200
commitca495758bd8bcbea66f00296d36d87f66cd5f4a8 (patch)
treef986fb042de8bc643d73875b45df30a98398f124 /core/js/octemplate.js
parent75e9015b5445e957f2454373bed67dac1741b5cb (diff)
downloadnextcloud-server-ca495758bd8bcbea66f00296d36d87f66cd5f4a8.tar.gz
nextcloud-server-ca495758bd8bcbea66f00296d36d87f66cd5f4a8.zip
Fix octemplate string escaping.
Diffstat (limited to 'core/js/octemplate.js')
-rw-r--r--core/js/octemplate.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/js/octemplate.js b/core/js/octemplate.js
index e69c6cc56e0..f7ee316f3b2 100644
--- a/core/js/octemplate.js
+++ b/core/js/octemplate.js
@@ -60,9 +60,9 @@
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]);
+ for (var key = 0; key < Object.keys(this.vars).length; key++) {
+ if(typeof this.vars[Object.keys(this.vars)[key]] === 'string') {
+ this.vars[Object.keys(this.vars)[key]] = self.options.escapeFunction(this.vars[Object.keys(this.vars)[key]]);
}
}
}
@@ -85,7 +85,7 @@
}
},
options: {
- escapeFunction: function(str) {return $('<i></i>').text(str).html();}
+ escapeFunction: escapeHTML
}
};