forked from mirror/pixelfed
commit
17758865dc
|
@ -49,6 +49,9 @@
|
|||
- Update InboxPipeline, increase timeout from 60s to 300s ([d1b888b5](https://github.com/pixelfed/pixelfed/commit/d1b888b5))
|
||||
- Update backup config, fixes #3793, #3920, #3931 ([b0c4cc30](https://github.com/pixelfed/pixelfed/commit/b0c4cc30))
|
||||
- Update FederationController, add two new queues (follow, shared) to prioritize follow request handling ([8ba33864](https://github.com/pixelfed/pixelfed/commit/8ba33864))
|
||||
- Dispatch follow accept/reject pipeline jobs to follow queue ([aaed2bf6](https://github.com/pixelfed/pixelfed/commit/aaed2bf6))
|
||||
- Update MediaStorageService, improve support for pleroma .blob avatars ([66226658](https://github.com/pixelfed/pixelfed/commit/66226658))
|
||||
- Update ApiV1Controller, remove min avatar size limit, fixes #3715 ([2b0db812](https://github.com/pixelfed/pixelfed/commit/2b0db812))
|
||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||
|
||||
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
||||
|
|
|
@ -221,7 +221,7 @@ class ApiV1Controller extends Controller
|
|||
abort_if(!$request->user(), 403);
|
||||
|
||||
$this->validate($request, [
|
||||
'avatar' => 'sometimes|mimetypes:image/jpeg,image/png|min:10|max:' . config('pixelfed.max_avatar_size'),
|
||||
'avatar' => 'sometimes|mimetypes:image/jpeg,image/png|max:' . config('pixelfed.max_avatar_size'),
|
||||
'display_name' => 'nullable|string|max:30',
|
||||
'note' => 'nullable|string|max:200',
|
||||
'locked' => 'nullable',
|
||||
|
|
|
@ -38,6 +38,8 @@ class RemoteAvatarFetch implements ShouldQueue
|
|||
* @var int
|
||||
*/
|
||||
public $tries = 1;
|
||||
public $timeout = 300;
|
||||
public $maxExceptions = 1;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
|
|
|
@ -25,8 +25,8 @@ class DeleteWorker implements ShouldQueue
|
|||
protected $headers;
|
||||
protected $payload;
|
||||
|
||||
public $timeout = 120;
|
||||
public $tries = 3;
|
||||
public $timeout = 300;
|
||||
public $tries = 1;
|
||||
public $maxExceptions = 1;
|
||||
|
||||
/**
|
||||
|
|
|
@ -203,6 +203,7 @@ class MediaStorageService {
|
|||
}
|
||||
|
||||
$mimes = [
|
||||
'application/octet-stream',
|
||||
'image/jpeg',
|
||||
'image/png',
|
||||
];
|
||||
|
@ -239,6 +240,15 @@ class MediaStorageService {
|
|||
}
|
||||
file_put_contents($tmpName, $data);
|
||||
|
||||
$mimeCheck = Storage::mimeType('remcache/' . $tmpPath);
|
||||
|
||||
if(!$mimeCheck || !in_array($mimeCheck, ['image/png', 'image/jpeg'])) {
|
||||
$avatar->last_fetched_at = now();
|
||||
$avatar->save();
|
||||
unlink($tmpName);
|
||||
return;
|
||||
}
|
||||
|
||||
$disk = Storage::disk($driver);
|
||||
$file = $disk->putFileAs($base, new File($tmpName), $path, 'public');
|
||||
$permalink = $disk->url($file);
|
||||
|
|
Loading…
Reference in New Issue