Browse Source

Merge pull request #2013 from pixelfed/staging

Update DiscoverController, fixes #2009
daniel 5 years ago
parent
commit
747c75636b
2 changed files with 4 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 3 1
      app/Http/Controllers/DiscoverController.php

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@
 - Updated robots.txt ([25101901](https://github.com/pixelfed/pixelfed/commit/25101901))
 - Updated mail panel blade view, fix markdown bug ([cbc63b04](https://github.com/pixelfed/pixelfed/commit/cbc63b04))
 - Updated self-diagnosis checks ([03f808c7](https://github.com/pixelfed/pixelfed/commit/03f808c7))
+- Updated DiscoverController, fixes #2009 ([b04c7170](https://github.com/pixelfed/pixelfed/commit/b04c7170))
 
 ## [v0.10.8 (2020-01-29)](https://github.com/pixelfed/pixelfed/compare/v0.10.7...v0.10.8)
 ### Added

+ 3 - 1
app/Http/Controllers/DiscoverController.php

@@ -42,7 +42,9 @@ class DiscoverController extends Controller
     {
         abort_if(!config('instance.discover.tags.is_public') && !Auth::check(), 403);
 
-        $tag = Hashtag::whereSlug($hashtag)->firstOrFail();
+        $tag = Hashtag::whereName($hashtag)
+          ->orWhere('slug', $hashtag)
+          ->firstOrFail();
         $tagCount = StatusHashtagService::count($tag->id);
         return view('discover.tags.show', compact('tag', 'tagCount'));
     }