Removing the user object from the cache after setting the avatar
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 11 Nov 2024 11:53:11 +0000 (12:53 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 11 Nov 2024 11:53:11 +0000 (12:53 +0100)
wcfsetup/install/files/lib/system/user/command/SetAvatar.class.php

index 823d4234dbbf70da8ca30d2020939b96c0c9d0df..7558372d54f26b2221e6ea7a7a0660e26106bade 100644 (file)
@@ -6,6 +6,7 @@ use wcf\data\file\File;
 use wcf\data\file\FileAction;
 use wcf\data\user\User;
 use wcf\data\user\UserEditor;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\user\group\assignment\UserGroupAssignmentHandler;
 use wcf\system\user\storage\UserStorageHandler;
 use wcf\system\user\UserProfileHandler;
@@ -39,6 +40,7 @@ final class SetAvatar
         ]);
 
         UserStorageHandler::getInstance()->reset([$this->user->userID], 'avatar');
+        UserProfileRuntimeCache::getInstance()->removeObject($this->user->userID);
 
         // check if the user will be automatically added to new user groups
         // because of the changed avatar