mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 03:59:39 +08:00
Delete previous avatar when uploading a new one
This commit is contained in:
parent
7f828fffbb
commit
9559ac1bb6
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user