Fix warning 'Undefined array key "name"'

This commit is contained in:
Michael 2022-11-29 23:21:27 +00:00
parent 8eca961aeb
commit 8eda9dfe7c
4 changed files with 4 additions and 6 deletions

View file

@ -65,9 +65,8 @@ class FollowedTags extends BaseApi
$saved_searches = DBA::select('search', ['id', 'term'], $condition);
while ($saved_search = DBA::fetch($saved_searches)) {
self::setBoundaries($saved_search['id']);
$tag = ['name' => ltrim($saved_search['term'], '#')];
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, $tag, [], true);
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($saved_search['term'], '#')], [], true);
$return[] = $hashtag->toArray();
}

View file

@ -45,9 +45,8 @@ class Tags extends BaseApi
$tag = ltrim($this->parameters['hashtag'], '#');
$following = DBA::exists('search', ['uid' => $uid, 'term' => '#' . $tag]);
$term = ['term' => $tag];
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, $term, [], $following);
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => $tag], [], $following);
System::jsonExit($hashtag->toArray());
}
}

View file

@ -45,7 +45,7 @@ class Follow extends BaseApi
DBA::insert('search', $fields);
}
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, $fields, [], true);
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($this->parameters['hashtag'])], [], true);
System::jsonExit($hashtag->toArray());
}
}

View file

@ -44,7 +44,7 @@ class Unfollow extends BaseApi
DBA::delete('search', $term);
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, $term, [], false);
$hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($this->parameters['hashtag'])], [], false);
System::jsonExit($hashtag->toArray());
}
}