Merge pull request #3127 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-01-05 19:56:35 -07:00 committed by GitHub
commit b34d97d6b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -85,6 +85,7 @@
- Updated ApiV1Controller, fix illegal operator bug by setting default min_id. ([415826f2](https://github.com/pixelfed/pixelfed/commit/415826f2))
- Updated StatusService, add getMastodon method for mastoapi compatibility. ([36a129fe](https://github.com/pixelfed/pixelfed/commit/36a129fe))
- Updated PublicApiController, fix accountStatuses pagination operator. ([85fc9dd0](https://github.com/pixelfed/pixelfed/commit/85fc9dd0))
- Updated PublicApiController, enforce only_media on accountStatuses method. Fixes #3105. ([861a2d36](https://github.com/pixelfed/pixelfed/commit/861a2d36))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.1 (2021-09-07)](https://github.com/pixelfed/pixelfed/compare/v0.11.0...v0.11.1)

View file

@ -737,6 +737,7 @@ class PublicApiController extends Controller
$max_id = $request->max_id;
$min_id = $request->min_id;
$scope = ['photo', 'photo:album', 'video', 'video:album'];
$onlyMedia = $request->input('only_media', true);
if(!$min_id && !$max_id) {
$min_id = 1;
@ -787,7 +788,16 @@ class PublicApiController extends Controller
}
return $status;
})
->filter(function($s) {
->filter(function($s) use($onlyMedia) {
if($onlyMedia) {
if(
!isset($s['media_attachments']) ||
!is_array($s['media_attachments']) ||
empty($s['media_attachments'])
) {
return false;
}
}
return $s;
})
->values();