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);
}
DI::mstdnError()->UnprocessableEntity();
}
- $term = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']];
+ $term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
DBA::delete('search', $term);