X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FFContact.php;h=1c5c186e6994adec3f171ac979092378663f0626;hb=1d86d79778bb7e2d00bd9031877e566a6037144e;hp=24421b8c0809a4f2e8803a8765f0960392f6188e;hpb=6e79da0b0c4aeee14da50c0ad5d0500b4a58eebb;p=friendica.git diff --git a/src/Model/FContact.php b/src/Model/FContact.php index 24421b8c08..1c5c186e69 100644 --- a/src/Model/FContact.php +++ b/src/Model/FContact.php @@ -60,7 +60,7 @@ class FContact $update = true; } - if ($person["guid"] == "") { + if (empty($person['guid']) || empty($person['uri-id'])) { $update = true; } } @@ -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);