Skip to content

Commit

Permalink
MDL-34991 Messaging : Fixed rendering of notifications with CRLF to g…
Browse files Browse the repository at this point in the history
…o through text_to_html() in message notifications view page.
  • Loading branch information
Aparup Banerjee committed Aug 21, 2012
1 parent 87e9331 commit 9949e91
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions message/lib.php
Expand Up @@ -844,7 +844,7 @@ function message_print_recent_notifications($user=null) {

$showicontext = false;
$showotheruser = false;
message_print_recent_messages_table($notifications, $user, $showotheruser, $showicontext);
message_print_recent_messages_table($notifications, $user, $showotheruser, $showicontext, true);
}

/**
Expand All @@ -854,9 +854,10 @@ function message_print_recent_notifications($user=null) {
* @param object $user the current user
* @param bool $showotheruser display information on the other user?
* @param bool $showicontext show text next to the action icons?
* @param bool $forcetexttohtml Force text to go through @see text_to_html() via @see format_text()
* @return void
*/
function message_print_recent_messages_table($messages, $user=null, $showotheruser=true, $showicontext=false) {
function message_print_recent_messages_table($messages, $user=null, $showotheruser=true, $showicontext=false, $forcetexttohtml=false) {
global $OUTPUT;
static $dateformat;

Expand Down Expand Up @@ -914,7 +915,7 @@ function message_print_recent_messages_table($messages, $user=null, $showotherus
}

echo html_writer::tag('span', userdate($message->timecreated, $dateformat), array('class' => 'messagedate'));
echo html_writer::tag('span', format_text($messagetoprint, FORMAT_HTML), array('class' => 'themessage'));
echo html_writer::tag('span', format_text($messagetoprint, $forcetexttohtml?FORMAT_MOODLE:FORMAT_HTML), array('class' => 'themessage'));
echo message_format_contexturl($message);
echo html_writer::end_tag('div');//end singlemessage
}
Expand Down

0 comments on commit 9949e91

Please sign in to comment.