From f36d787b1333ab85770f41701b5ff6db99e91b88 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 6 May 2021 10:06:43 +0200 Subject: [PATCH] Fix deleting content from moderation report page Close WoltLab/com.woltlab.wbb#461 --- .../ModerationQueueReportAction.class.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php index b66ece5e6d..e5866238a1 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php @@ -36,11 +36,13 @@ class ModerationQueueReportAction extends ModerationQueueAction { $this->validateRemoveReport(); - if (!ModerationQueueReportManager::getInstance()->canRemoveContent($this->queue->getDecoratedObject())) { - throw new PermissionDeniedException(); + foreach ($this->getObjects() as $moderationQueueEditor) { + if (!ModerationQueueReportManager::getInstance()->canRemoveContent($moderationQueueEditor->getDecoratedObject())) { + throw new PermissionDeniedException(); + } } - $this->parameters['message'] = (isset($this->parameters['message']) ? StringUtil::trim($this->parameters['message']) : ''); + $this->parameters['message'] = isset($this->parameters['message']) ? StringUtil::trim($this->parameters['message']) : ''; } /** @@ -48,13 +50,14 @@ class ModerationQueueReportAction extends ModerationQueueAction */ public function removeContent() { - // mark content as deleted - ModerationQueueReportManager::getInstance()->removeContent( - $this->queue->getDecoratedObject(), - $this->parameters['message'] - ); + foreach ($this->getObjects() as $moderationQueueEditor) { + ModerationQueueReportManager::getInstance()->removeContent( + $moderationQueueEditor->getDecoratedObject(), + $this->parameters['message'] + ); - $this->queue->markAsConfirmed(); + $moderationQueueEditor->markAsConfirmed(); + } $this->unmarkItems(); } -- 2.20.1