mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-61359 message: Updated sender contact text to text node content
This commit is contained in:
parent
543005a342
commit
7805012e59
2 changed files with 3 additions and 5 deletions
File diff suppressed because one or more lines are too long
|
@ -553,15 +553,13 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
|
||||||
* @return {String} The altered text
|
* @return {String} The altered text
|
||||||
*/
|
*/
|
||||||
Contacts.prototype._getContactText = function(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) {
|
if (text.length > this._messageLength) {
|
||||||
text = text.substr(0, this._messageLength - 3);
|
text = text.substr(0, this._messageLength - 3);
|
||||||
text += '...';
|
text += '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
// Text node prevents script injection through HTML entities.
|
||||||
|
return document.createTextNode(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue