From c4fdc7466d9ee7453a1382bcd1e81f388ca8e68b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 24 Oct 2021 23:00:40 -0400 Subject: [PATCH] Test item psid against PermissionSet::PUBLIC constant instead in ActivityPub\Objects - Address https://github.com/friendica/friendica/issues/10755#issuecomment-950393419 --- src/Module/ActivityPub/Objects.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Module/ActivityPub/Objects.php b/src/Module/ActivityPub/Objects.php index 5ee1b65d8..232c80e5b 100644 --- a/src/Module/ActivityPub/Objects.php +++ b/src/Module/ActivityPub/Objects.php @@ -31,6 +31,7 @@ use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Network\HTTPException; use Friendica\Protocol\ActivityPub; +use Friendica\Security\PermissionSet\Repository\PermissionSet; use Friendica\Util\HTTPSignature; use Friendica\Util\Network; use Friendica\Util\Strings; @@ -84,11 +85,8 @@ class Objects extends BaseModule $requester_id = Contact::getIdForURL($requester, $item['uid']); if (!empty($requester_id)) { $permissionSets = DI::permissionSet()->selectByContactId($requester_id, $item['uid']); - if (!empty($permissionSets)) { - $psid = array_merge($permissionSets->column('id'), - [DI::permissionSet()->selectPublicForUser($item['uid'])]); - $validated = in_array($item['psid'], $psid); - } + $psids = array_merge($permissionSets->column('id'), [PermissionSet::PUBLIC]); + $validated = in_array($item['psid'], $psids); } } }