浏览代码

Update DiscoverController, fixes #2009

Daniel Supernault 5 年之前
父节点
当前提交
b04c7170d7
共有 1 个文件被更改,包括 3 次插入1 次删除
  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'));
     }