mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 00:05:29 +00:00
parent
fadd0534a4
commit
989e42497a
2 changed files with 6 additions and 5 deletions
|
@ -164,15 +164,16 @@ class Profile extends Model
|
|||
if(substr($avatar->cdn_url, 0, 8) === 'https://') {
|
||||
return $avatar->cdn_url;
|
||||
} else {
|
||||
return url($avatar->cdn_url);
|
||||
}
|
||||
}
|
||||
|
||||
if($avatar->is_remote) {
|
||||
return url('/storage/avatars/default.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
$path = $avatar->media_path;
|
||||
|
||||
if(substr($path, 0, 6) !== 'public') {
|
||||
return url('/storage/avatars/default.jpg');
|
||||
}
|
||||
|
||||
$path = "{$path}?v={$avatar->change_count}";
|
||||
|
||||
return config('app.url') . Storage::url($path);
|
||||
|
|
|
@ -246,7 +246,7 @@ class MediaStorageService {
|
|||
$file = $disk->putFileAs($base, new File($tmpName), $path, 'public');
|
||||
$permalink = $disk->url($file);
|
||||
|
||||
$avatar->media_path = $base . $path;
|
||||
$avatar->media_path = $base . '/' . $path;
|
||||
$avatar->is_remote = true;
|
||||
$avatar->cdn_url = $local ? config('app.url') . $permalink : $permalink;
|
||||
$avatar->size = $head['length'];
|
||||
|
|
Loading…
Reference in a new issue