1
0
mirror of https://github.com/flarum/core.git synced 2025-07-26 11:10:41 +02:00

Delete previous avatar when uploading a new one

This commit is contained in:
Toby Zerner
2015-05-06 11:22:35 +09:30
parent 5f044c2634
commit a40ef46aa8

View File

@@ -47,7 +47,9 @@ class UploadAvatarCommandHandler
'target' => $this->uploadDir, 'target' => $this->uploadDir,
]); ]);
// @todo delete old avatar if ($mount->has($file = "target://$user->avatar_path")) {
$mount->delete($file);
}
$user->changeAvatarPath($uploadName); $user->changeAvatarPath($uploadName);