Skip to content

Commit

Permalink
Merge branch 'MDL-72153-310' of git://github.com/paulholden/moodle in…
Browse files Browse the repository at this point in the history
…to MOODLE_310_STABLE
  • Loading branch information
andrewnicols committed Aug 26, 2021
2 parents 5549586 + 1d3aa1b commit ea67397
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions user/classes/privacy/provider.php
Expand Up @@ -394,7 +394,14 @@ protected static function export_user(\stdClass $user, \context $context) {
'secret' => $user->secret,
'picture' => $user->picture,
'url' => $user->url,
'description' => format_text($user->description, $user->descriptionformat, ['context' => $context]),
'description' => format_text(
writer::with_context($context)->rewrite_pluginfile_urls(
[],
'user',
'profile',
'',
$user->description
), $user->descriptionformat, ['context' => $context]),
'maildigest' => transform::yesno($user->maildigest),
'maildisplay' => $user->maildisplay,
'autosubscribe' => transform::yesno($user->autosubscribe),
Expand All @@ -407,10 +414,7 @@ protected static function export_user(\stdClass $user, \context $context) {
'middlename' => format_string($user->middlename, true, ['context' => $context]),
'alternatename' => format_string($user->alternatename, true, ['context' => $context])
];
if (isset($data->description)) {
$data->description = writer::with_context($context)->rewrite_pluginfile_urls(
[get_string('privacy:descriptionpath', 'user')], 'user', 'profile', '', $data->description);
}

writer::with_context($context)->export_area_files([], 'user', 'profile', 0)
->export_data([], $data);
// Export profile images.
Expand Down

0 comments on commit ea67397

Please sign in to comment.