Skip to content

Commit

Permalink
[K6.1] Deleting attachment from topic failing #9551
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Aug 8, 2023
1 parent e5a79e7 commit 8c46b6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/site/src/Controllers/TopicController.php
Expand Up @@ -273,11 +273,12 @@ public function removeattachments()
}

$attach_id = $this->input->getInt('file_id', 0);
$userid = $this->input->getInt('userid', 0);
$success = [];
$instance = KunenaAttachmentHelper::get($attach_id);

if (
KunenaUserHelper::getMyself()->userid == $instance->userid || KunenaUserHelper::getMyself()->isAdmin()
KunenaUserHelper::getMyself()->userid == $userid || KunenaUserHelper::getMyself()->isAdmin()
|| KunenaUserHelper::getMyself()->isModerator()
) {
$editor_text = $this->app->input->get->get('editor_text', '', 'raw');
Expand Down
2 changes: 1 addition & 1 deletion src/site/template/aurelia/layouts/topic/edit/default.php
Expand Up @@ -71,7 +71,7 @@
);
$this->doc->addScriptOptions(
'com_kunena.kunena_upload_files_rem',
KunenaRoute::_('index.php?option=com_kunena&view=topic&task=removeattachments&format=json&' .
KunenaRoute::_('index.php?option=com_kunena&view=topic&task=removeattachments&format=json&userid=' . KunenaUserHelper::getMyself()->userid . '&' .
Session::getFormToken() . '=1', false)
);
$this->doc->addScriptOptions(
Expand Down

0 comments on commit 8c46b6d

Please sign in to comment.