summaryrefslogtreecommitdiffstats
path: root/js/field.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/field.js')
-rw-r--r--js/field.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/js/field.js b/js/field.js
index 778451daf..fdacd4728 100644
--- a/js/field.js
+++ b/js/field.js
@@ -738,10 +738,7 @@ $(function() {
formatResult: function(suggestion, currentValue) {
return (suggestion.data.name === '' ?
suggestion.data.login : suggestion.data.name + ' (' + suggestion.data.login + ')')
- .replace(/&/g, '&')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/"/g, '&quot;');
+ .htmlEncode();
},
onSearchStart: function(params) {
var that = $(this);
@@ -800,11 +797,7 @@ $(function() {
autoSelectFirst: true,
formatResult: function(suggestion, currentValue) {
// disable <b> wrapping of matched substring
- return suggestion.value
- .replace(/&/g, '&amp;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/"/g, '&quot;');
+ return suggestion.value.htmlEncode();
},
onSelect: function() {
this.focus();