MDL-65257 message_email: apply filters to course and group names
authorMark Nelson <markn@moodle.com>
Mon, 29 Apr 2019 07:20:29 +0000 (15:20 +0800)
committerMark Nelson <markn@moodle.com>
Mon, 29 Apr 2019 07:20:29 +0000 (15:20 +0800)
message/output/email/classes/output/email_digest.php

index b36b49d..d19f641 100644 (file)
@@ -109,10 +109,12 @@ class email_digest implements \renderable, \templatable {
                 $grouppictureurl = $url->out(false);
             }
 
+            $coursecontext = \context_course::instance($conversation->courseid);
+
             $conversationformatted = new \stdClass();
-            $conversationformatted->groupname = $conversation->name;
+            $conversationformatted->groupname = format_string($conversation->name, true, ['context' => $coursecontext]);
             $conversationformatted->grouppictureurl = $grouppictureurl;
-            $conversationformatted->coursename = $conversation->coursename;
+            $conversationformatted->coursename = format_string($conversation->coursename, true, ['context' => $coursecontext]);
             $conversationformatted->numberofunreadmessages = count($messages);
             $conversationformatted->messages = [];
             $conversationformatted->viewallmessageslink = \html_writer::link($viewallmessageslink,