]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/APContact.php
Move another function
[friendica.git] / src / Model / APContact.php
index 72c644ab9ac0d15302d321f4ca0489f4c19c50a0..917e0895dcb1ff8020c069fd970d0057a136a49c 100644 (file)
@@ -7,6 +7,7 @@
 namespace Friendica\Model;
 
 use Friendica\BaseObject;
+use Friendica\Core\Logger;
 use Friendica\Database\DBA;
 use Friendica\Protocol\ActivityPub;
 use Friendica\Util\Network;
@@ -105,6 +106,10 @@ class APContact extends BaseObject
 
                $compacted = JsonLD::compact($data);
 
+               if (empty($compacted['@id'])) {
+                       return false;
+               }
+
                $apcontact = [];
                $apcontact['url'] = $compacted['@id'];
                $apcontact['uuid'] = JsonLD::fetchElement($compacted, 'diaspora:guid');
@@ -192,7 +197,7 @@ class APContact extends BaseObject
                // Update the gcontact table
                DBA::update('gcontact', $contact_fields, ['nurl' => normalise_link($url)]);
 
-               logger('Updated profile for ' . $url, LOGGER_DEBUG);
+               Logger::log('Updated profile for ' . $url, Logger::DEBUG);
 
                return $apcontact;
        }