summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-05-09 12:23:57 +0200
committerjld3103 <jld3103yt@gmail.com>2023-05-15 18:18:21 +0200
commite294045223992056051659f620be5a49ece6d8e8 (patch)
treea6bd2f7ecfb6458875a62d2b1b0d5929f9db250a /lib/private
parent8362eea14e3cf6700ccc50778a802a3f47a5e080 (diff)
downloadnextcloud-server-e294045223992056051659f620be5a49ece6d8e8.tar.gz
nextcloud-server-e294045223992056051659f620be5a49ece6d8e8.zip
Properly clear cached avatars
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Avatar/AvatarManager.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/private/Avatar/AvatarManager.php b/lib/private/Avatar/AvatarManager.php
index 5c4f04de6d6..4125c8eb0a8 100644
--- a/lib/private/Avatar/AvatarManager.php
+++ b/lib/private/Avatar/AvatarManager.php
@@ -160,13 +160,8 @@ class AvatarManager implements IAvatarManager {
public function clearCachedAvatars() {
$users = $this->config->getUsersForUserValue('avatar', 'generated', 'true');
foreach ($users as $userId) {
- try {
- $folder = $this->appData->getFolder($userId);
- $folder->delete();
- } catch (NotFoundException $e) {
- $this->logger->debug("No cache for the user $userId. Ignoring...");
- }
- $this->config->setUserValue($userId, 'avatar', 'generated', 'false');
+ // This also bumps the avatar version leading to cache invalidation in browsers
+ $this->getAvatar($userId)->remove();
}
}