Trim the tag
This commit is contained in:
parent
85f57e69fa
commit
934766c364
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user