Escape HTML when displaying search results

This commit is contained in:
2017-05-31 17:14:14 +02:00
parent a806f294b2
commit d67f65019e
4 changed files with 10 additions and 8 deletions

View File

@@ -96,7 +96,9 @@ script.
limit: 10,
templates: {
suggestion: function (hit) {
return hit._highlightResult.full_name.value + ' (' + hit._highlightResult.username.value + ')';
var suggestion = hit.full_name + ' (' + hit.username + ')';
var $p = $('p').text(suggestion);
return $p.html();
}
}
}