/* (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, '<').
+ replace(/>/g, '>');
+}
+
/**
* The Autoselect
*/
return stringified;
},
resultListFormat : function(oResultData, enteredText, sResultMatch) {
- return ( oResultData.real_name + " (" + oResultData.email + ")");
+ return ( _escapeHTML(oResultData.real_name) + " (" + _escapeHTML(oResultData.email) + ")");
},
debug_helper : function ( ){
/* used to help debug any errors that might happen */