浏览代码

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

Daniel Supernault 2 年之前
父节点
当前提交
9f7672f570
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/Observers/AvatarObserver.php

+ 1 - 1
app/Observers/AvatarObserver.php

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