diff --git a/src/Database/DBA.php b/src/Database/DBA.php index 9f34a86c15..72769dca9b 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -45,6 +45,7 @@ class DBA */ private static $logger; private static $server_info = ''; + /** @var PDO|mysqli */ private static $connection; private static $driver; private static $error = false; @@ -496,6 +497,7 @@ class DBA break; } + /** @var $stmt mysqli_stmt|PDOStatement */ if (!$stmt = self::$connection->prepare($sql)) { $errorInfo = self::$connection->errorInfo(); self::$error = $errorInfo[2]; diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 99142b50ec..4c34c5e15f 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -741,11 +741,11 @@ class Receiver * @param boolean $trust_source Do we trust the provided object? * @param integer $uid User ID for the signature that we use to fetch data * - * @return array with trusted and valid object data + * @return array|false with trusted and valid object data * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - private static function fetchObject($object_id, $object = [], $trust_source = false, $uid = 0) + private static function fetchObject(string $object_id, array $object = [], bool $trust_source = false, int $uid = 0) { // By fetching the type we check if the object is complete. $type = JsonLD::fetchElement($object, '@type'); @@ -791,6 +791,7 @@ class Receiver } Logger::log('Unhandled object type: ' . $type, Logger::DEBUG); + return false; } /** diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index 60bb844226..def8f1b628 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -749,7 +749,7 @@ class PortableContact $friendica = false; $gnusocial = false; - if (is_array($nodeinfo['protocols']['inbound'])) { + if (!empty($nodeinfo['protocols']['inbound']) && is_array($nodeinfo['protocols']['inbound'])) { foreach ($nodeinfo['protocols']['inbound'] as $inbound) { if ($inbound == 'diaspora') { $diaspora = true;