]> git.mxchange.org Git - friendica.git/commitdiff
Fix warning 'Undefined array key "name"'
authorMichael <heluecht@pirati.ca>
Tue, 29 Nov 2022 23:21:27 +0000 (23:21 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 29 Nov 2022 23:21:27 +0000 (23:21 +0000)
src/Module/Api/Mastodon/FollowedTags.php
src/Module/Api/Mastodon/Tags.php
src/Module/Api/Mastodon/Tags/Follow.php
src/Module/Api/Mastodon/Tags/Unfollow.php

index eb5e32fdc143c85264f6bea775e4db4e4471701c..7e9dd49c92226af1b976370911dc72363a74543e 100644 (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();
                }
 
index d38899ac0f294828030e253f49ae8c6266de93f1..606aecaff264fc4a727c9f1202d0621a0741d2be 100644 (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());
        }
 }
index 22f8fa3f270d56fc80a72615f678ba0f95d46de8..b5879bb0e4bc1e45866d7ec93cff749df99ea723 100644 (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());
        }
 }
index f3fbad2e5ab0e3e4cd3003c22679447e7da1f6a9..8530c9d777b8bb4ef7c33e19c69f3450d529ce23 100644 (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());
        }
 }