$tags = DBA::select('tag', ['name'], $condition, $params);
$hashtags = [];
+
+ if (!is_iterable($tags)) {
+ return $hashtags;
+ }
+
foreach ($tags as $tag) {
if ($version == 1) {
$hashtags[] = $tag['name'];
// 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));
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;
}
/**
- * @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;