]> git.mxchange.org Git - friendica.git/commitdiff
Fix PHPStan error in Security class
authorArt4 <art4@wlabs.de>
Tue, 25 Feb 2025 07:59:39 +0000 (07:59 +0000)
committerArt4 <art4@wlabs.de>
Tue, 25 Feb 2025 07:59:39 +0000 (07:59 +0000)
src/Security/Security.php

index 6b0deb75ecff358aba7d7968871b08e2a2feeaeb..9056596f271fd46f425e03cdc74a2a34c83a46b8 100644 (file)
@@ -45,25 +45,25 @@ class Security
                                return true;
                        } elseif ($verified === 1) {
                                return false;
+                       }
+
+                       $user = User::getById($owner);
+                       if (!$user || $user['blockwall']) {
+                               $verified = 1;
+                               return false;
+                       }
+
+                       $contact = Contact::getById($cid);
+                       if (!is_array($contact) || $contact['blocked'] || $contact['readonly'] || $contact['pending']) {
+                               $verified = 1;
+                               return false;
+                       }
+
+                       if (in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND]) || ($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY)) {
+                               $verified = 2;
+                               return true;
                        } else {
-                               $user = User::getById($owner);
-                               if (!$user || $user['blockwall']) {
-                                       $verified = 1;
-                                       return false;
-                               }
-
-                               $contact = Contact::getById($cid);
-                               if ($contact || $contact['blocked'] || $contact['readonly'] || $contact['pending']) {
-                                       $verified = 1;
-                                       return false;
-                               }
-
-                               if (in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND]) || ($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY)) {
-                                       $verified = 2;
-                                       return true;
-                               } else {
-                                       $verified = 1;
-                               }
+                               $verified = 1;
                        }
                }