mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-66808 mod_forum: set the format col to FORMAT_PLAIN when it is plain
This commit is contained in:
parent
c98f448866
commit
bfe6cfc9ab
1 changed files with 3 additions and 6 deletions
|
@ -90,11 +90,8 @@ if ($form->is_cancelled()) {
|
||||||
$striphtml = !empty($data->striphtml);
|
$striphtml = !empty($data->striphtml);
|
||||||
$humandates = !empty($data->humandates);
|
$humandates = !empty($data->humandates);
|
||||||
|
|
||||||
$fields = ['id', 'discussion', 'parent', 'userid', 'created', 'modified', 'mailed', 'subject', 'message'];
|
$fields = ['id', 'discussion', 'parent', 'userid', 'created', 'modified', 'mailed', 'subject', 'message',
|
||||||
if (!$striphtml) {
|
'messageformat', 'messagetrust', 'attachment', 'totalscore', 'mailnow', 'deleted', 'privatereplyto'];
|
||||||
$fields[] = 'messageformat';
|
|
||||||
}
|
|
||||||
$fields = array_merge($fields, ['messagetrust', 'attachment', 'totalscore', 'mailnow', 'deleted', 'privatereplyto']);
|
|
||||||
|
|
||||||
$datamapper = $legacydatamapperfactory->get_post_data_mapper();
|
$datamapper = $legacydatamapperfactory->get_post_data_mapper();
|
||||||
$exportdata = new ArrayObject($datamapper->to_legacy_objects($posts));
|
$exportdata = new ArrayObject($datamapper->to_legacy_objects($posts));
|
||||||
|
@ -116,7 +113,7 @@ if ($form->is_cancelled()) {
|
||||||
// matter what. We use http://example.com/.
|
// matter what. We use http://example.com/.
|
||||||
$data->message = str_replace('@@PLUGINFILE@@/', 'http://example.com/', $data->message);
|
$data->message = str_replace('@@PLUGINFILE@@/', 'http://example.com/', $data->message);
|
||||||
$data->message = html_to_text(format_text($data->message, $data->messageformat), 0, false);
|
$data->message = html_to_text(format_text($data->message, $data->messageformat), 0, false);
|
||||||
unset($data->messageformat);
|
$data->messageformat = FORMAT_PLAIN;
|
||||||
}
|
}
|
||||||
if ($humandates) {
|
if ($humandates) {
|
||||||
$data->created = userdate($data->created);
|
$data->created = userdate($data->created);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue