Fix default value of contact parameter of OStatus::import in mod/salmon
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 22 Jan 2019 13:53:53 +0000 (08:53 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 22 Jan 2019 13:53:53 +0000 (08:53 -0500)
mod/salmon.php
src/Protocol/OStatus.php

index 536a451..84d2942 100644 (file)
@@ -184,7 +184,7 @@ function salmon_post(App $a, $xml = '') {
        // Placeholder for hub discovery.
        $hub = '';
 
-       $contact_rec = ((DBA::isResult($r)) ? $r[0] : null);
+       $contact_rec = ((DBA::isResult($r)) ? $r[0] : []);
 
        OStatus::import($data, $importer, $contact_rec, $hub);
 
index acb49ef..b1cc4f4 100644 (file)
@@ -74,7 +74,7 @@ class OStatus
 
                $author["contact-id"] = $contact["id"];
 
-               $contact = null;
+               $contact = [];
 
 /*
                This here would be better, but we would get problems with contacts from the statusnet addon
@@ -231,7 +231,7 @@ class OStatus
 
                        GContact::link($gcid, $contact["uid"], $contact["id"]);
                } elseif ($contact["network"] != Protocol::DFRN) {
-                       $contact = null;
+                       $contact = [];
                }
 
                return $author;