diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2013-08-28 03:59:43 -0700 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2013-08-28 03:59:43 -0700 |
commit | 9843c8e83871475e432434d290aa6c89892f8b7b (patch) | |
tree | 07963c4a3771fd2f1d49e5084b9aad837d79591b /core | |
parent | 3e7ddbc9d932ce6c8594f9080404f85d64492cd7 (diff) | |
parent | 776d64f804534eee724a9cd08f6c242002a75ddc (diff) | |
download | nextcloud-server-9843c8e83871475e432434d290aa6c89892f8b7b.tar.gz nextcloud-server-9843c8e83871475e432434d290aa6c89892f8b7b.zip |
Merge pull request #4434 from owncloud/fix_octemplate_escaping
Fix octemplate string escaping.
Diffstat (limited to 'core')
-rw-r--r-- | core/js/octemplate.js | 9 |
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 } }; |