diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c456340..aca3e79a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Release Notes ## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.5...dev) + +### Updates +- Update ApiV1Controller, fix blocking remote accounts. Closes #4256 ([8e71e0c0](https://github.com/pixelfed/pixelfed/commit/8e71e0c0)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.5 (2023-03-25)](https://github.com/pixelfed/pixelfed/compare/v0.11.4...v0.11.5) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 77df97704..9b79ab868 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1012,7 +1012,7 @@ class ApiV1Controller extends Controller $profile = Profile::findOrFail($id); - if($profile->user->is_admin == true) { + if($profile->user && $profile->user->is_admin == true) { abort(400, 'You cannot block an admin'); } @@ -1047,7 +1047,7 @@ class ApiV1Controller extends Controller ]); RelationshipService::refresh($pid, $id); - + UserFilterService::block($pid, $id); $resource = new Fractal\Resource\Item($profile, new RelationshipTransformer()); $res = $this->fractal->createData($resource)->toArray();