From: Joshua Rüsweg Date: Mon, 20 Jan 2020 16:37:41 +0000 (+0100) Subject: Fix revoking of user trophies X-Git-Tag: 5.2.2~44 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d24ec35e7031144307923875fa6fdfeda50abce4;p=GitHub%2FWoltLab%2FWCF.git Fix revoking of user trophies --- diff --git a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php index 09bc0c88c1..c7da8e79cf 100644 --- a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php +++ b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php @@ -182,6 +182,9 @@ class TrophyConditionHandler extends SingletonFactory { // In order not to get all users who do not fulfill the conditions (in case of // doubt there can be many), we filter for users who have received the trophy. $userList->getConditionBuilder()->add('user_table.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_trophy WHERE trophyID IN (?))', [$trophy->trophyID]); + + // Prevents us from getting faulty UserTrophyIDs. + $userList->getConditionBuilder()->add('user_trophy.trophyID = ?', [$trophy->trophyID]); $userList->readObjects(); // We now return an array of userTrophyIDs instead of user objects to remove them directly via DBOAction.