Pārlūkot izejas kodu

Update SiteController, return 404 for users attempting to view their own Follow Intent

Daniel Supernault 5 gadi atpakaļ
vecāks
revīzija
8e9b544f50
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      app/Http/Controllers/SiteController.php

+ 1 - 0
app/Http/Controllers/SiteController.php

@@ -116,6 +116,7 @@ class SiteController extends Controller
         ]);
         $profile = Profile::whereUsername($request->input('user'))->firstOrFail();
         $user = $request->user();
+        abort_if($profile->id == $user->profile_id, 404);
         $following = $user != null ? FollowerService::follows($user->profile_id, $profile->id) : false;
         return view('site.intents.follow', compact('profile', 'user', 'following'));
     }