From: Michael Date: Wed, 14 Mar 2018 19:47:14 +0000 (+0000) Subject: Avoid an error in OnePoll when the contact was "null". X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7db0b850cb80af8a60768fb7f78f15acd5c5635d;p=friendica.git Avoid an error in OnePoll when the contact was "null". --- diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index 42b0d9f8c4..6475cc82b7 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -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']) {