1
0
Fork 0

Merge pull request #4222 from pixelfed/staging

Staging
This commit is contained in:
daniel 2023-03-04 14:37:58 -07:00 committed by GitHub
commit af5bc07557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -116,6 +116,7 @@
- Update mute/block logic with admin defined limits and improved filtering to skip deleted accounts ([5b879f01](https://github.com/pixelfed/pixelfed/commit/5b879f01))
- Update FollowPipeline, fix followers_count and following_count counters ([6153b620](https://github.com/pixelfed/pixelfed/commit/6153b620))
- Update ApiV1Controller, fix media update. Fixes #4196 ([f3164650](https://github.com/pixelfed/pixelfed/commit/f3164650))
- Update SearchApiV2Service, fix hashtag search. ([1992b5bc](https://github.com/pixelfed/pixelfed/commit/1992b5bc))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)

View File

@ -122,11 +122,15 @@ class SearchApiV2Service
protected function hashtags()
{
$mastodonMode = self::$mastodonMode;
$q = $this->query->input('q');
$limit = $this->query->input('limit') ?? 20;
$offset = $this->query->input('offset') ?? 0;
$query = $this->query->input('q') . '%';
return Hashtag::where('can_search', true)
->where('name', 'like', $query)
$query = Str::startsWith($q, '#') ? substr($q, 1) . '%' : $q . '%';
return Hashtag::where('name', 'like', $query)
->where(function($q) {
return $q->where('can_search', true)
->orWhereNull('can_search');
})
->offset($offset)
->limit($limit)
->get()