Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

message MDL-26077 fixed up a problem with html tags being stripped out

  • Loading branch information...
commit cd4ca97611aa0b1e3efc032af62e9aced89bee18 1 parent 77bfc4c
@andyjdavis andyjdavis authored samhemelryk committed
View
2  lib/moodlelib.php
@@ -9112,7 +9112,7 @@ function message_popup_window() {
$smallmessage = get_string('unreadnewnotification', 'message');
}
if (!empty($smallmessage)) {
- $strmessages .= '<div id="usermessage">'.$smallmessage.'</div>';
+ $strmessages .= '<div id="usermessage">'.s($smallmessage).'</div>';
}
}
View
6 message/lib.php
@@ -1879,9 +1879,9 @@ function message_format_message($message, $format='', $keywords='', $class='othe
//if supplied display small messages as fullmessage may contain boilerplate text that shouldnt appear in the messaging UI
if (!empty($message->smallmessage)) {
- $messagetext = format_text($message->smallmessage, FORMAT_MOODLE, $options);
+ $messagetext = format_text(s($message->smallmessage), FORMAT_MOODLE, $options);
} else {
- $messagetext = format_text($message->fullmessage, $message->fullmessageformat, $options);
+ $messagetext = format_text(s($message->fullmessage), $message->fullmessageformat, $options);
}
$messagetext .= message_format_contexturl($message);
@@ -1945,7 +1945,7 @@ function message_post_message($userfrom, $userto, $message, $format) {
}
$eventdata->fullmessageformat = $format;
- $eventdata->smallmessage = strip_tags($message);//strip just in case there are is any html that would break the popup notification
+ $eventdata->smallmessage = $message;//store the message unfiltered. Clean up on output.
$s = new stdClass();
$s->sitename = $SITE->shortname;
View
1  message/output/jabber/message_output_jabber.php
@@ -59,6 +59,7 @@ function send_message($eventdata){
}
$jabberaddress = $jabberaddresses[$eventdata->userto->id];
+ //calling s() on smallmessage causes Jabber to display things like &lt; Jabber != a browser
$jabbermessage = fullname($eventdata->userfrom).': '.$eventdata->smallmessage;
if (!empty($eventdata->contexturl)) {
Please sign in to comment.
Something went wrong with that request. Please try again.