Trim the tag

This commit is contained in:
Michael 2022-11-28 04:04:27 +00:00
parent 85f57e69fa
commit 934766c364
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}

View file

@ -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);