X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FFContact.php;h=1c5c186e6994adec3f171ac979092378663f0626;hb=763e26419636a5dbb107e893ddf4f04b2156fc6d;hp=0fc4633275284d761ecc4fc4f8d7135bc90f781b;hpb=3634009c0a7cb28d9cf8839bc3bbce6fd1f593f6;p=friendica.git diff --git a/src/Model/FContact.php b/src/Model/FContact.php index 0fc4633275..1c5c186e69 100644 --- a/src/Model/FContact.php +++ b/src/Model/FContact.php @@ -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);