Browse Source

Update PublicApiController, fix visibility for guests

Daniel Supernault 3 tháng trước cách đây
mục cha
commit
537e179537

+ 1 - 5
app/Http/Controllers/PublicApiController.php

@@ -788,15 +788,11 @@ class PublicApiController extends Controller
 
 
     private function determineVisibility($profile, $user)
     private function determineVisibility($profile, $user)
     {
     {
-        if (! $user || ! isset($user->profile_id)) {
-            return [];
-        }
-
         if (! $profile || ! isset($profile['id'])) {
         if (! $profile || ! isset($profile['id'])) {
             return [];
             return [];
         }
         }
 
 
-        if ($profile['id'] == $user->profile_id) {
+        if ($user && $profile['id'] == $user->profile_id) {
             return ['public', 'unlisted', 'private'];
             return ['public', 'unlisted', 'private'];
         }
         }