From: Michael Date: Tue, 29 Nov 2022 23:21:27 +0000 (+0000) Subject: Fix warning 'Undefined array key "name"' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8eda9dfe7cec31d10ab86b3544be33dad5d35ea9;p=friendica.git Fix warning 'Undefined array key "name"' --- diff --git a/src/Module/Api/Mastodon/FollowedTags.php b/src/Module/Api/Mastodon/FollowedTags.php index eb5e32fdc1..7e9dd49c92 100644 --- a/src/Module/Api/Mastodon/FollowedTags.php +++ b/src/Module/Api/Mastodon/FollowedTags.php @@ -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(); } diff --git a/src/Module/Api/Mastodon/Tags.php b/src/Module/Api/Mastodon/Tags.php index d38899ac0f..606aecaff2 100644 --- a/src/Module/Api/Mastodon/Tags.php +++ b/src/Module/Api/Mastodon/Tags.php @@ -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()); } } diff --git a/src/Module/Api/Mastodon/Tags/Follow.php b/src/Module/Api/Mastodon/Tags/Follow.php index 22f8fa3f27..b5879bb0e4 100644 --- a/src/Module/Api/Mastodon/Tags/Follow.php +++ b/src/Module/Api/Mastodon/Tags/Follow.php @@ -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()); } } diff --git a/src/Module/Api/Mastodon/Tags/Unfollow.php b/src/Module/Api/Mastodon/Tags/Unfollow.php index f3fbad2e5a..8530c9d777 100644 --- a/src/Module/Api/Mastodon/Tags/Unfollow.php +++ b/src/Module/Api/Mastodon/Tags/Unfollow.php @@ -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()); } }