Explorar o código

Update ProfileController

Daniel Supernault %!s(int64=5) %!d(string=hai) anos
pai
achega
7654205408
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      app/Http/Controllers/ProfileController.php

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

@@ -237,10 +237,12 @@ class ProfileController extends Controller
         abort_if(!config('instance.stories.enabled') || !$request->user(), 404);
         $profile = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();
         $pid = $profile->id;
+        $authed = Auth::user()->profile;
+        abort_if($pid != $authed->id && $profile->followedBy($authed) == false, 404);
         $exists = Story::whereProfileId($pid)
             ->where('expires_at', '>', now())
             ->count();
-        abort_unless($exists > 1, 404);
+        abort_unless($exists > 0, 404);
         return view('profile.story', compact('pid'));
     }
 }