MDL-61359 message: Updated sender contact text to text node content

This commit is contained in:
Michael Hawkins
2018-06-29 10:26:07 +08:00
parent f61ee4e857
commit 6924e32e4a
2 changed files with 3 additions and 5 deletions
File diff suppressed because one or more lines are too long
+2 -4
View File
@@ -553,15 +553,13 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @return {String} The altered text
*/
Contacts.prototype._getContactText = function(text) {
// Remove the HTML tags to render the contact text.
text = $(document.createElement('div')).html(text).text();
if (text.length > this._messageLength) {
text = text.substr(0, this._messageLength - 3);
text += '...';
}
return text;
// Text node prevents script injection through HTML entities.
return document.createTextNode(text);
};
/**