]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/OStatus.php
Fixing https://github.com/friendica/friendica/issues/6338#issuecomment-466749280
[friendica.git] / src / Protocol / OStatus.php
index 051c0d6c8c99db01946652afbba4f46680818ddb..38105e452a929dbdf589675964837c4b7e4c39cb 100644 (file)
@@ -53,7 +53,7 @@ class OStatus
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       private static function fetchAuthor(DOMXPath $xpath, $context, array $importer, &$contact, $onlyfetch)
+       private static function fetchAuthor(DOMXPath $xpath, $context, array $importer, array &$contact = null, $onlyfetch)
        {
                $author = [];
                $author["author-link"] = XML::getFirstNodeValue($xpath, 'atom:author/atom:uri/text()', $context);
@@ -72,7 +72,7 @@ class OStatus
                }
                $author["author-id"] = Contact::getIdForURL($author["author-link"]);
 
-               $author["contact-id"] = $contact["id"];
+               $author['contact-id'] = defaults($contact, 'id', $author['author-id']);
 
                $contact = [];
 
@@ -322,7 +322,7 @@ class OStatus
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       private static function process($xml, array $importer, &$contact, &$hub, $stored = false, $initialize = true)
+       private static function process($xml, array $importer, array &$contact = null, &$hub, $stored = false, $initialize = true)
        {
                if ($initialize) {
                        self::$itemlist = [];