diff --git a/src/Module/Api/Mastodon/Search.php b/src/Module/Api/Mastodon/Search.php index 9301c60cdc..c054329dde 100644 --- a/src/Module/Api/Mastodon/Search.php +++ b/src/Module/Api/Mastodon/Search.php @@ -196,6 +196,11 @@ class Search extends BaseApi $tags = DBA::select('tag', ['name'], $condition, $params); $hashtags = []; + + if (!is_iterable($tags)) { + return $hashtags; + } + foreach ($tags as $tag) { if ($version == 1) { $hashtags[] = $tag['name']; diff --git a/src/Module/Api/Twitter/Lists/Ownership.php b/src/Module/Api/Twitter/Lists/Ownership.php index bdf34ed280..0b18f6bc18 100644 --- a/src/Module/Api/Twitter/Lists/Ownership.php +++ b/src/Module/Api/Twitter/Lists/Ownership.php @@ -48,8 +48,11 @@ class Ownership extends BaseApi // loop through all circles $lists = []; - foreach ($circles as $circle) { - $lists[] = $this->friendicaCircle->createFromId($circle['id']); + + if (is_iterable($circles)) { + foreach ($circles as $circle) { + $lists[] = $this->friendicaCircle->createFromId($circle['id']); + } } $this->response->addFormattedContent('statuses', ['lists' => ['lists' => $lists]], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid)); diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index 86c2fcf736..629295f7c8 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -59,9 +59,9 @@ class Network extends Timeline protected $dateFrom; /** @var string */ protected $dateTo; - /** @var int */ + /** @var bool */ protected $star; - /** @var int */ + /** @var bool */ protected $mention; /** @var AppHelper */ diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php index 330f6953a6..28666c8a44 100644 --- a/src/Module/Filer/RemoveTag.php +++ b/src/Module/Filer/RemoveTag.php @@ -11,7 +11,6 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Session\Capability\IHandleUserSessions; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\Post; use Friendica\Module\Response; @@ -59,15 +58,15 @@ class RemoveTag extends BaseModule } /** - * @param array $request The $_REQUEST array - * @param string|null $type Output parameter with the computed type - * @param string|null $term Output parameter with the computed term + * @param array $request The $_REQUEST array + * @param string|int|null $type Output parameter with the computed type + * @param string|null $term Output parameter with the computed term * * @return int The relevant HTTP code * * @throws \Exception */ - private function removeTag(array $request, string &$type = null, string &$term = null): int + private function removeTag(array $request, &$type = null, string &$term = null): int { $item_id = $this->parameters['id'] ?? 0;