Ver Fonte

Update PublicApiController, fix visibility for guests

Daniel Supernault há 3 meses atrás
pai
commit
537e179537
1 ficheiros alterados com 1 adições e 5 exclusões
  1. 1 5
      app/Http/Controllers/PublicApiController.php

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

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