From 4ff55e71c91f67b941ba515a52728faa118991f6 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 20 Mar 2024 11:15:48 +0100 Subject: [PATCH] User array filter --- .../queue/ModerationQueueReportManager.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php index 98cf5ce620..0d13c1d7e7 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php @@ -247,11 +247,9 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager $objectType = ObjectTypeCache::getInstance()->getObjectType($queue->objectTypeID); $processor = $objectType->getProcessor(); - foreach ($userIDs as $key => $userID) { - if (!$processor->isAffectedUser($queue, $userID)) { - unset($userIDs[$key]); - } - } + $userIDs = \array_filter($userIDs, function ($userID) use ($processor, $queue) { + return $processor->isAffectedUser($queue, $userID); + }); if ($userIDs === []) { return; } -- 2.20.1