Update AvatarObserver, fix cloud delete bug by checking if cloud storage is enabled

This commit is contained in:
Daniel Supernault 2022-12-04 22:21:09 -07:00
parent 25bc08adb9
commit 9f7672f570
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -65,7 +65,7 @@ class AvatarObserver
@unlink($path);
}
if($avatar->cdn_url) {
if($avatar->cdn_url && config_cache('pixelfed.cloud_storage')) {
$disk = Storage::disk(config('filesystems.cloud'));
$base = Str::startsWith($avatar->media_path, 'cache/avatars/');
if($base && $disk->exists($avatar->media_path)) {