Explorar o código

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

Daniel Supernault %!s(int64=2) %!d(string=hai) anos
pai
achega
9f7672f570
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Observers/AvatarObserver.php

+ 1 - 1
app/Observers/AvatarObserver.php

@@ -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)) {