From 934766c36406b1797741ae67b9b3840598f2cccb Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 28 Nov 2022 04:04:27 +0000 Subject: [PATCH] Trim the tag --- src/Module/Api/Mastodon/Tags/Follow.php | 2 +- src/Module/Api/Mastodon/Tags/Unfollow.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);