From e373be7dde1fb40c8c5e33bf10f88a3d3d0d4b43 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 20 Jul 2024 01:01:27 +0100 Subject: [PATCH] Skip deleting default avatar from disk on delete Signed-off-by: snipe --- app/Http/Controllers/SettingsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index c5c36d7b81..7e682ae773 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -455,8 +455,9 @@ class SettingsController extends Controller // Default avatar upload $setting = $request->handleImages($setting, 500, 'default_avatar', 'avatars', 'default_avatar'); - if ($request->input('clear_default_avatar') == '1') { + if (($request->input('clear_default_avatar') == '1') && ($setting->default_avatar!='default.png')) { + \Log::debug('Deleting default avatar'); if (($setting->default_avatar) && (Storage::exists('avatars/'.$setting->default_avatar))) { Storage::disk('public')->delete('avatars/'.$setting->default_avatar); }