From: Reed Loden Date: Tue, 7 Jun 2011 20:11:27 +0000 (+0200) Subject: Bug 657194: Use YUI's escapeHTML() instead of our custom one X-Git-Tag: bugzilla-4.1.3~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4e3261b663c2087030aa5afca5c07580689c64f;p=thirdparty%2Fbugzilla.git Bug 657194: Use YUI's escapeHTML() instead of our custom one r=mkanat a=LpSolit --- diff --git a/js/field.js b/js/field.js index 949c210a30..1a3bc3efd4 100644 --- a/js/field.js +++ b/js/field.js @@ -669,13 +669,6 @@ function browserCanHideOptions(aSelect) { /* (end) option hiding code */ -// A convenience function to sanitize raw text for harmful HTML before outputting -function _escapeHTML(text) { - return text.replace(/&/g, '&'). - replace(//g, '>'); -} - /** * The Autoselect */ @@ -701,7 +694,8 @@ YAHOO.bugzilla.userAutocomplete = { return stringified; }, resultListFormat : function(oResultData, enteredText, sResultMatch) { - return ( _escapeHTML(oResultData.real_name) + " (" + _escapeHTML(oResultData.name) + ")"); + return ( YAHOO.lang.escapeHTML(oResultData.real_name) + " (" + + YAHOO.lang.escapeHTML(oResultData.name) + ")"); }, debug_helper : function ( ){ /* used to help debug any errors that might happen */