From: Reed Loden Date: Tue, 29 May 2012 14:46:23 +0000 (-0700) Subject: Bug 754561 - Escape HTML in keywords in the auto-complete form X-Git-Tag: bugzilla-4.0.7~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f7f53adc29abe8af273ec0235a7db441c23f6eb;p=thirdparty%2Fbugzilla.git Bug 754561 - Escape HTML in keywords in the auto-complete form [r=LpSolit a=LpSolit] --- diff --git a/js/field.js b/js/field.js index ce3eb0ba49..3a0111c15e 100644 --- a/js/field.js +++ b/js/field.js @@ -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 = [","," "];