]> git.mxchange.org Git - friendica.git/commitdiff
An empty user id does not have children
authorMichael <heluecht@pirati.ca>
Sat, 19 Jun 2021 06:27:25 +0000 (06:27 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 19 Jun 2021 06:27:25 +0000 (06:27 +0000)
src/Model/User.php
src/Security/Authentication.php

index f81b1ce764ad9bf1d2a3814edac58ec50d196556..14f40662b2ea162dcf36689cb579cd731e9ae17b 100644 (file)
@@ -1505,6 +1505,10 @@ class User
         */
        public static function identities($uid)
        {
+               if (empty($uid)) {
+                       return [];
+               }
+
                $identities = [];
 
                $user = DBA::selectFirst('user', ['uid', 'nickname', 'username', 'parent-uid'], ['uid' => $uid]);
index 430ede13b4bc5e6eb6f1f8e6bf93601d1de1fec0..ce101477e0a2ee043764ea18b70ac98c8d0ad970 100644 (file)
@@ -342,8 +342,10 @@ class Authentication
                        $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $user_record['uid']]);
 
                        // Set the login date for all identities of the user
-                       $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()],
-                               ['parent-uid' => $masterUid, 'account_removed' => false]);
+                       if (!empty($masterUid)) {
+                               $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()],
+                                       ['parent-uid' => $masterUid, 'account_removed' => false]);
+                       }
                }
 
                if ($login_initial) {