mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
message MDL-25380 preventing html tags appearing in emailed messages when a message is sent to course participants
This commit is contained in:
parent
a864e5ddc3
commit
156205fc97
@ -1561,10 +1561,16 @@ function message_post_message($userfrom, $userto, $message, $format, $messagetyp
|
||||
//using string manager directly so that strings in the message will be in the message recipients language rather than the senders
|
||||
$eventdata->subject = get_string_manager()->get_string('unreadnewmessage', 'message', fullname($userfrom), $userto->lang);
|
||||
|
||||
$eventdata->fullmessage = $message;
|
||||
if ($format==FORMAT_HTML) {
|
||||
$eventdata->fullmessage = '';
|
||||
$eventdata->fullmessagehtml = $message;
|
||||
} else {
|
||||
$eventdata->fullmessage = $message;
|
||||
$eventdata->fullmessagehtml = '';
|
||||
}
|
||||
|
||||
$eventdata->fullmessageformat = $format;
|
||||
$eventdata->fullmessagehtml = '';
|
||||
$eventdata->smallmessage = $message;
|
||||
$eventdata->smallmessage = strip_tags($message);//strip just in case there are is any html that would break the popup notification
|
||||
|
||||
$s = new stdClass();
|
||||
$s->sitename = $SITE->shortname;
|
||||
|
@ -94,7 +94,7 @@ $count = 0;
|
||||
foreach ($_POST as $k => $v) {
|
||||
if (preg_match('/^(user|teacher)(\d+)$/',$k,$m)) {
|
||||
if (!array_key_exists($m[2],$SESSION->emailto[$id])) {
|
||||
if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,mailformat,lastaccess')) {
|
||||
if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,mailformat,lastaccess, lang')) {
|
||||
$SESSION->emailto[$id][$m[2]] = $user;
|
||||
$count++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user