Skip to content

Commit

Permalink
MDL-72169 privacy: format course name/summary during export.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Aug 31, 2021
1 parent 6259988 commit 63fea60
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions course/classes/privacy/provider.php
Expand Up @@ -192,11 +192,17 @@ public static function export_context_data(\core_privacy\local\request\contextli
$context = \context_course::instance($course->id);
$courseformat = $course->format !== 'site' ? get_string('pluginname', 'format_' . $course->format) : get_string('site');
$data = (object) [
'fullname' => $course->fullname,
'fullname' => format_string($course->fullname, true, ['context' => $context]),
'shortname' => $course->shortname,
'idnumber' => $course->idnumber,
'summary' => writer::with_context($context)->rewrite_pluginfile_urls([], 'course', 'summary', 0,
format_string($course->summary)),
'summary' => format_text(
writer::with_context($context)->rewrite_pluginfile_urls(
[],
'course',
'summary',
0,
$course->summary
), $course->summaryformat, ['context' => $context]),
'format' => $courseformat,
'startdate' => transform::datetime($course->startdate),
'enddate' => transform::datetime($course->enddate)
Expand Down

0 comments on commit 63fea60

Please sign in to comment.