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:
@@ -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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user