Merge branch 'MDL-72153' of git://github.com/paulholden/moodle

This commit is contained in:
Andrew Nicols 2021-08-26 11:31:32 +08:00
commit 84556387ca

View File

@ -376,7 +376,14 @@ class provider implements
'lastip' => $user->lastip,
'secret' => $user->secret,
'picture' => $user->picture,
'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),
@ -389,10 +396,7 @@ class provider implements
'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.