Check for explicit types

This commit is contained in:
Art4 2024-11-18 07:44:26 +00:00
parent 2b40e49e6e
commit 5772c70216
2 changed files with 3 additions and 3 deletions

View file

@ -323,7 +323,7 @@ class ClientToServer
$requester_id = Contact::getIdForURL($requester, $owner['uid']); $requester_id = Contact::getIdForURL($requester, $owner['uid']);
if (!empty($requester_id)) { if (!empty($requester_id)) {
$permissionSets = DI::permissionSet()->selectByContactId($requester_id, $owner['uid']); $permissionSets = DI::permissionSet()->selectByContactId($requester_id, $owner['uid']);
if (count($permissionSets)) { if (count($permissionSets) > 0) {
$condition = ['psid' => array_merge($permissionSets->column('id'), $condition = ['psid' => array_merge($permissionSets->column('id'),
[DI::permissionSet()->selectPublicForUser($owner['uid'])])]; [DI::permissionSet()->selectPublicForUser($owner['uid'])])];
} }

View file

@ -619,7 +619,7 @@ class Receiver
} }
$actor = JsonLD::fetchElement($activity, 'as:actor', '@id'); $actor = JsonLD::fetchElement($activity, 'as:actor', '@id');
if (empty($actor)) { if ($actor === null || $actor === '') {
Logger::info('Empty actor', ['activity' => $activity]); Logger::info('Empty actor', ['activity' => $activity]);
return true; return true;
} }
@ -642,7 +642,7 @@ class Receiver
// Test the provided signatures against the actor and "attributedTo" // Test the provided signatures against the actor and "attributedTo"
if ($trust_source) { if ($trust_source) {
if (!empty($attributed_to) && $actor !== null) { if ($attributed_to !== false && $attributed_to !== '') {
$trust_source = (in_array($actor, $signer) && in_array($attributed_to, $signer)); $trust_source = (in_array($actor, $signer) && in_array($attributed_to, $signer));
} else { } else {
$trust_source = in_array($actor, $signer); $trust_source = in_array($actor, $signer);