]> git.mxchange.org Git - friendica.git/commitdiff
Fix selectFirst usage in Model\Contact
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 11 Jan 2018 01:13:51 +0000 (20:13 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Thu, 11 Jan 2018 01:13:51 +0000 (20:13 -0500)
src/Model/Contact.php

index 2323c583b46fdb2d95843fab1dfb14e497b79ab0..d92d4dd1d2678e89d557ebd161415981803cd385 100644 (file)
@@ -1246,15 +1246,13 @@ class Contact extends BaseObject
                        );
                }
 
-               $r = dba::selectFirst('contact', ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
-
-               if (!DBM::is_result($r)) {
+               $contact = dba::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
+               if (!DBM::is_result($contact)) {
                        $result['message'] .= t('Unable to retrieve contact information.') . EOL;
                        return $result;
                }
 
-               $contact = $r;
-               $contact_id = $r['id'];
+               $contact_id = $contact['id'];
                $result['cid'] = $contact_id;
 
                Group::addMember(User::getDefaultGroup($uid, $contact["network"]), $contact_id);