Merge branch 'MDL-65275_master' of git://github.com/markn86/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2019-04-22 00:58:37 +02:00
commit 1d75eb9bad

View File

@ -458,6 +458,24 @@ class post extends exporter {
];
}
/**
* This method returns the parameters for the post's message to
* use with the function external_format_text().
*
* @return array
*/
protected function get_format_parameters_for_message() {
return [
'component' => 'mod_forum',
'filearea' => 'post',
'itemid' => $this->post->get_id(),
'options' => [
'para' => false,
'trusted' => $this->post->is_message_trusted()
]
];
}
/**
* Get the message text from a post.
*
@ -467,15 +485,7 @@ class post extends exporter {
private function get_message(post_entity $post) : string {
global $CFG;
$context = $this->related['context'];
$message = file_rewrite_pluginfile_urls(
$post->get_message(),
'pluginfile.php',
$context->id,
'mod_forum',
'post',
$post->get_id()
);
$message = $post->get_message();
if (!empty($CFG->enableplagiarism)) {
require_once($CFG->libdir . '/plagiarismlib.php');
@ -489,16 +499,6 @@ class post extends exporter {
]);
}
$message = format_text(
$message,
$post->get_message_format(),
(object) [
'para' => false,
'trusted' => $post->is_message_trusted(),
'context' => $context
]
);
return $message;
}