]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 754561 - Escape HTML in keywords in the auto-complete form
authorReed Loden <reed@reedloden.com>
Tue, 29 May 2012 14:46:23 +0000 (07:46 -0700)
committerReed Loden <reed@reedloden.com>
Tue, 29 May 2012 14:46:23 +0000 (07:46 -0700)
[r=LpSolit a=LpSolit]

js/field.js

index ce3eb0ba4913af9ff37fded9d8c11d160f92ebee..3a0111c15e5f51326fa2a05fe003674c6e1e8b96 100644 (file)
@@ -733,6 +733,9 @@ YAHOO.bugzilla.userAutocomplete = {
 
 YAHOO.bugzilla.keywordAutocomplete = {
     dataSource : null,
+    formatEscapedResult : function(oResultData, sQuery, sResultMatch) {
+        return ((sResultMatch) ? _escapeHTML(sResultMatch) : "");
+    },
     init_ds : function(){
         this.dataSource = new YAHOO.util.LocalDataSource( YAHOO.bugzilla.keyword_array );
     },
@@ -742,6 +745,7 @@ YAHOO.bugzilla.keywordAutocomplete = {
         }
         var keywordAutoComp = new YAHOO.widget.AutoComplete(field, container, this.dataSource);
         keywordAutoComp.maxResultsDisplayed = YAHOO.bugzilla.keyword_array.length;
+        keywordAutoComp.formatResult = this.formatEscapedResult;
         keywordAutoComp.minQueryLength = 0;
         keywordAutoComp.useIFrame = true;
         keywordAutoComp.delimChar = [","," "];