diff --git a/src/Module/Api/Mastodon/Tags/Follow.php b/src/Module/Api/Mastodon/Tags/Follow.php index e2261f3fd..767245b60 100644 --- a/src/Module/Api/Mastodon/Tags/Follow.php +++ b/src/Module/Api/Mastodon/Tags/Follow.php @@ -40,7 +40,7 @@ class Follow extends BaseApi DI::mstdnError()->UnprocessableEntity(); } - $fields = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']]; + $fields = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')]; if (!DBA::exists('search', $fields)) { DBA::insert('search', $fields); } diff --git a/src/Module/Api/Mastodon/Tags/Unfollow.php b/src/Module/Api/Mastodon/Tags/Unfollow.php index 465c1974b..163b65003 100644 --- a/src/Module/Api/Mastodon/Tags/Unfollow.php +++ b/src/Module/Api/Mastodon/Tags/Unfollow.php @@ -40,7 +40,7 @@ class Unfollow extends BaseApi DI::mstdnError()->UnprocessableEntity(); } - $term = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']]; + $term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')]; DBA::delete('search', $term);