mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-67637 core_message: only preview lastmessage text if safe to do so
If any html/script tags are found in the text() value, don't display it.
This commit is contained in:
parent
f914f99a76
commit
4e80934653
3 changed files with 6 additions and 3 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -223,9 +223,12 @@ function(
|
|||
// If that's not possible, we'll report it under the catch-all 'other media'.
|
||||
var messagePreview = $(lastMessage.text).text();
|
||||
if (messagePreview) {
|
||||
// The text value of the message must have no html/script tags.
|
||||
if (messagePreview.indexOf('<') == -1) {
|
||||
return messagePreview;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// As a fallback, report unknowns as 'other media' type content.
|
||||
var pix = 'i/messagecontentmultimediageneral';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue