mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01: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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -223,7 +223,10 @@ function(
|
||||
// If that's not possible, we'll report it under the catch-all 'other media'.
|
||||
var messagePreview = $(lastMessage.text).text();
|
||||
if (messagePreview) {
|
||||
return messagePreview;
|
||||
// The text value of the message must have no html/script tags.
|
||||
if (messagePreview.indexOf('<') == -1) {
|
||||
return messagePreview;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user