From 9949e91a5721814621f7a64e5af0f2adc1e6c354 Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Tue, 21 Aug 2012 15:13:41 +0800 Subject: [PATCH] MDL-34991 Messaging : Fixed rendering of notifications with CRLF to go through text_to_html() in message notifications view page. --- message/lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/message/lib.php b/message/lib.php index db95cea31a9..1e7135d848f 100644 --- a/message/lib.php +++ b/message/lib.php @@ -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); } /** @@ -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; @@ -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 }