]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/FContact.php
More "q" calls have been replaced
[friendica.git] / src / Model / FContact.php
index 0fc4633275284d761ecc4fc4f8d7135bc90f781b..1c5c186e6994adec3f171ac979092378663f0626 100644 (file)
@@ -121,14 +121,9 @@ class FContact
        {
                Logger::info('fcontact', ['guid' => $fcontact_guid]);
 
-               $r = q(
-                       "SELECT `url` FROM `fcontact` WHERE `url` != '' AND `network` = '%s' AND `guid` = '%s'",
-                       DBA::escape(Protocol::DIASPORA),
-                       DBA::escape($fcontact_guid)
-               );
-
-               if (DBA::isResult($r)) {
-                       return $r[0]['url'];
+               $fcontact = DBA::selectFirst('fcontact', ['url'], ["`url` != ? AND `network` = ? AND `guid` = ?", '', Protocol::DIASPORA, $fcontact_guid]);
+               if (DBA::isResult($fcontact)) {
+                       return $fcontact['url'];
                }
 
                return null;
@@ -176,7 +171,7 @@ class FContact
                $suggest['body'] = $note;
 
                $hash = Strings::getRandomHex();
-               $fields = ['uid' => $suggest['uid'], 'fid' => $fid, 'contact-id' => $suggest['cid'], 
+               $fields = ['uid' => $suggest['uid'], 'fid' => $fid, 'contact-id' => $suggest['cid'],
                        'note' => $suggest['body'], 'hash' => $hash, 'datetime' => DateTimeFormat::utcNow(), 'blocked' => false];
                DBA::insert('intro', $fields);