From 9b8e50a6f699ce0b6b0a937da0cb6e5be1dd12e4 Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Mon, 17 Jan 2022 10:17:26 +0100 Subject: [PATCH] Use `UserProfileRuntimeCache` to receive user object --- .../queue/AbstractModerationQueueHandler.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php index 3d471220a0..0f6bd091d3 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php @@ -5,8 +5,7 @@ namespace wcf\system\moderation\queue; use wcf\data\DatabaseObject; use wcf\data\moderation\queue\ModerationQueue; use wcf\data\moderation\queue\ModerationQueueAction; -use wcf\data\user\User; -use wcf\data\user\UserProfile; +use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\InvalidObjectTypeException; use wcf\system\exception\SystemException; @@ -120,9 +119,9 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler */ public function isAffectedUser(ModerationQueue $queue, $userID) { - $user = new UserProfile(new User($userID)); + $userProfile = UserProfileRuntimeCache::getInstance()->getObject($userID); - return $user->getPermission($this->requiredPermission); + return $userProfile->getPermission($this->requiredPermission); } /** -- 2.20.1