Skip to content

Commit

Permalink
MDL-79509 mod_wiki: Improve comment editing
Browse files Browse the repository at this point in the history
  • Loading branch information
roland04 authored and Jenkins committed Oct 4, 2023
1 parent ce38fda commit 4777e96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mod/wiki/editcomments.php
Expand Up @@ -64,6 +64,9 @@
if (!$comment = $DB->get_record('comments', array('id' => $commentid))) {
print_error('invalidcomment');
}
if ($USER->id != $comment->userid) {
throw new \moodle_exception('cannotviewpage', 'wiki');
}
}

$editcomments->set_page($page);
Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/pagelib.php
Expand Up @@ -835,7 +835,7 @@ private function edit_comment_form($com) {

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);
Expand Down

0 comments on commit 4777e96

Please sign in to comment.