Browse Source

Update DiscoverController, fixes #2009

Daniel Supernault 5 năm trước cách đây
mục cha
commit
b04c7170d7
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      app/Http/Controllers/DiscoverController.php

+ 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'));
     }