]> git.mxchange.org Git - friendica.git/commitdiff
Avoid an error in OnePoll when the contact was "null".
authorMichael <heluecht@pirati.ca>
Wed, 14 Mar 2018 19:47:14 +0000 (19:47 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 14 Mar 2018 19:47:14 +0000 (19:47 +0000)
src/Worker/OnePoll.php

index 42b0d9f8c4f38d876ae4bcb30d4ba32f0519e007..6475cc82b7031b09d30be8fbd4922e2bf4a720e8 100644 (file)
@@ -582,11 +582,15 @@ class OnePoll
 
                        logger("Consume feed of contact ".$contact['id']);
 
-                       consume_feed($xml, $importer, $contact, $hub, 1, 1);
+                       // Use a copy of the contact to avoid problems.
+                       // The contact parameter is called by reference.
+                       $contact2 = $contact;
+                       consume_feed($xml, $importer, $contact2, $hub, 1, 1);
 
                        // do it twice. Ensures that children of parents which may be later in the stream aren't tossed
 
-                       consume_feed($xml, $importer, $contact, $hub, 1, 2);
+                       $contact2 = $contact;
+                       consume_feed($xml, $importer, $contact2, $hub, 1, 2);
 
                        $hubmode = 'subscribe';
                        if ($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly']) {