Merge pull request #7267 from annando/notice

Avoid a notice in AP Receiver
This commit is contained in:
Hypolite Petovan 2019-06-14 06:01:52 -04:00 committed by GitHub
commit fa3b5f2bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,6 +194,11 @@ class Receiver
return []; return [];
} }
if (!is_string($object_id)) {
Logger::info('Invalid object id', ['object' => $object_id]);
return [];
}
$object_type = self::fetchObjectType($activity, $object_id, $uid); $object_type = self::fetchObjectType($activity, $object_id, $uid);
// Fetch the content only on activities where this matters // Fetch the content only on activities where this matters
@ -779,7 +784,7 @@ class Receiver
if ($type == 'as:Announce') { if ($type == 'as:Announce') {
$object_id = JsonLD::fetchElement($object, 'object', '@id'); $object_id = JsonLD::fetchElement($object, 'object', '@id');
if (empty($object_id)) { if (empty($object_id) || !is_string($object_id)) {
return false; return false;
} }
return self::fetchObject($object_id, [], false, $uid); return self::fetchObject($object_id, [], false, $uid);