forked from mirror/pixelfed
Update MediaStorageService
This commit is contained in:
parent
253a7c8c71
commit
1de7a136f6
1 changed files with 4 additions and 1 deletions
|
@ -236,7 +236,10 @@ class MediaStorageService {
|
||||||
$tmpBase = storage_path('app/remcache/');
|
$tmpBase = storage_path('app/remcache/');
|
||||||
$tmpPath = 'avatar_' . $avatar->profile_id . '-' . $path;
|
$tmpPath = 'avatar_' . $avatar->profile_id . '-' . $path;
|
||||||
$tmpName = $tmpBase . $tmpPath;
|
$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);
|
file_put_contents($tmpName, $data);
|
||||||
|
|
||||||
$disk = Storage::disk($driver);
|
$disk = Storage::disk($driver);
|
||||||
|
|
Loading…
Reference in a new issue