return true;
}
} else {
- $attributed_to = '';
+ $attributed_to = null;
}
// Test the provided signatures against the actor and "attributedTo"
if ($trust_source) {
- if ($attributed_to !== false && $attributed_to !== '') {
+ if (!is_null($attributed_to)) {
$trust_source = (in_array($actor, $signer) && in_array($attributed_to, $signer));
} else {
$trust_source = in_array($actor, $signer);
}
+ if (!$trust_source) {
+ DI::logger()->info('Actor missmatch. Activity trust could not be achieved.', ['type' => $type, 'signer' => $signer, 'actor' => $actor, 'attributedTo' => $attributed_to]);
+ }
}
// Lemmy announces activities.
* @param $type
* @param $type_value
*
- * @return string|null fetched element
+ * @return mixed|null fetched element. If the element is not found, null is returned.
*/
public static function fetchElement($array, $element, $key = '@id', $type = null, $type_value = null)
{