]> git.mxchange.org Git - friendica.git/commitdiff
Simplified code
authorMichael <heluecht@pirati.ca>
Wed, 29 Jul 2020 14:59:55 +0000 (14:59 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 29 Jul 2020 14:59:55 +0000 (14:59 +0000)
src/Model/User.php

index 7b88aac1897dd93d6066f73ddedd67ea106bd267..46f0776b4e1e7a89eae87a61fb81d788781594a5 100644 (file)
@@ -194,15 +194,13 @@ class User
        public static function getFirstAdmin(array $fields = [])
        {
                if (!empty(DI::config()->get('config', 'admin_nickname'))) {
-                       $administrator = self::getByNickname(DI::config()->get('config', 'admin_nickname'), $fields);
+                       return self::getByNickname(DI::config()->get('config', 'admin_nickname'), $fields);
                } elseif (!empty(DI::config()->get('config', 'admin_email'))) {
                        $adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
-                       $administrator = self::getByEmail($adminList[0], $fields);
-               }
-               if (!empty($administrator)) {
-                       return $administrator;
+                       return self::getByEmail($adminList[0], $fields);
+               } else {
+                       return [];
                }
-               return [];
        }
 
        /**