]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix octemplate string escaping.
authorThomas Tanghus <thomas@tanghus.net>
Wed, 14 Aug 2013 21:06:43 +0000 (23:06 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Wed, 14 Aug 2013 21:06:43 +0000 (23:06 +0200)
core/js/octemplate.js
lib/base.php

index e69c6cc56e066fed3a03c3054fdfa040da2300c0..f7ee316f3b206526325e4b0a5e15f0c51be25b4e 100644 (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
                }
        };
 
index eaee84246512ec137417a313773a6e43a4e0727e..18c172759b4e69975c5db2ab6607e799f91e387c 100644 (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" );