MDL-79509 mod_wiki: Improve comment editing

This commit is contained in:
Mikel Martín 2023-09-27 14:07:14 +02:00 committed by Jenkins
parent 77766f9c8a
commit 5fec728be9
2 changed files with 4 additions and 1 deletions

View File

@ -64,6 +64,9 @@ if ($action == 'edit') {
if (!$comment = $DB->get_record('comments', array('id' => $commentid))) {
throw new \moodle_exception('invalidcomment');
}
if ($USER->id != $comment->userid) {
throw new \moodle_exception('cannotviewpage', 'wiki');
}
}
$editcomments->set_page($page);

View File

@ -835,7 +835,7 @@ class page_wiki_editcomment extends page_wiki {
if ($this->format == 'html') {
$com->action = 'edit';
$com->entrycomment_editor['text'] = $com->content;
$com->entrycomment_editor['text'] = clean_text($com->content, $this->format);
$com->commentoptions = array('trusttext' => true, 'maxfiles' => 0);
$this->form->set_data($com);