mirror of
https://github.com/flarum/core.git
synced 2025-07-24 10:11:43 +02:00
Delete previous avatar when uploading a new one
This commit is contained in:
@@ -47,7 +47,9 @@ class UploadAvatarCommandHandler
|
||||
'target' => $this->uploadDir,
|
||||
]);
|
||||
|
||||
// @todo delete old avatar
|
||||
if ($mount->has($file = "target://$user->avatar_path")) {
|
||||
$mount->delete($file);
|
||||
}
|
||||
|
||||
$user->changeAvatarPath($uploadName);
|
||||
|
||||
|
Reference in New Issue
Block a user