Trim the tag
This commit is contained in:
@@ -40,7 +40,7 @@ class Follow extends BaseApi
|
|||||||
DI::mstdnError()->UnprocessableEntity();
|
DI::mstdnError()->UnprocessableEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']];
|
$fields = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
|
||||||
if (!DBA::exists('search', $fields)) {
|
if (!DBA::exists('search', $fields)) {
|
||||||
DBA::insert('search', $fields);
|
DBA::insert('search', $fields);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Unfollow extends BaseApi
|
|||||||
DI::mstdnError()->UnprocessableEntity();
|
DI::mstdnError()->UnprocessableEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
$term = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']];
|
$term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
|
||||||
|
|
||||||
DBA::delete('search', $term);
|
DBA::delete('search', $term);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user