Browse Source

Fix octemplate string escaping.

tags/v6.0.0alpha2
Thomas Tanghus 11 years ago
parent
commit
ca495758bd
2 changed files with 5 additions and 5 deletions
  1. 4
    4
      core/js/octemplate.js
  2. 1
    1
      lib/base.php

+ 4
- 4
core/js/octemplate.js View File

@@ -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
}
};


+ 1
- 1
lib/base.php View File

@@ -257,8 +257,8 @@ class OC {
OC_Util::addScript("compatibility");
OC_Util::addScript("jquery.ocdialog");
OC_Util::addScript("oc-dialogs");
OC_Util::addScript("octemplate");
OC_Util::addScript("js");
OC_Util::addScript("octemplate");
OC_Util::addScript("eventsource");
OC_Util::addScript("config");
//OC_Util::addScript( "multiselect" );

Loading…
Cancel
Save