]> git.mxchange.org Git - friendica.git/commitdiff
Fix Fatal errors in Protocol\OStatus (#5466)
authorHypolite Petovan <mrpetovan@eml.cc>
Mon, 23 Jul 2018 11:48:44 +0000 (07:48 -0400)
committerGitHub <noreply@github.com>
Mon, 23 Jul 2018 11:48:44 +0000 (07:48 -0400)
src/Protocol/OStatus.php

index a443f65cef6015841b97349214bcbc3eee7f9f18..02b9664d5af4be21bef8745b5641b657589a9aea 100644 (file)
@@ -288,7 +288,7 @@ class OStatus
         * @param string $hub      Called by reference, returns the fetched hub data
         * @return void
         */
-       public static function import($xml, array $importer, array &$contact, &$hub)
+       public static function import($xml, array $importer, array &$contact = null, &$hub)
        {
                self::process($xml, $importer, $contact, $hub);
        }
@@ -1704,6 +1704,10 @@ class OStatus
 
                $parent = Item::selectFirst([], ['uri' => $item["thr-parent"], 'uid' => $item["uid"]]);
 
+               if (!$parent) {
+                       $parent = [];
+               }
+
                XML::addElement($doc, $as_object, "activity:object-type", self::constructObjecttype($parent));
 
                self::entryContent($doc, $as_object, $parent, $owner, "New entry");