Преглед изворни кода

Update MediaStorageService

Daniel Supernault пре 2 година
родитељ
комит
1de7a136f6
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      app/Services/MediaStorageService.php

+ 4 - 1
app/Services/MediaStorageService.php

@@ -236,7 +236,10 @@ class MediaStorageService {
 		$tmpBase = storage_path('app/remcache/');
 		$tmpPath = 'avatar_' . $avatar->profile_id . '-' . $path;
 		$tmpName = $tmpBase . $tmpPath;
-		$data = file_get_contents($url, false, null, 0, $head['length']);
+		$data = @file_get_contents($url, false, null, 0, $head['length']);
+		if(!$data) {
+			return;
+		}
 		file_put_contents($tmpName, $data);
 
 		$disk = Storage::disk($driver);