From 7db0b850cb80af8a60768fb7f78f15acd5c5635d Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 14 Mar 2018 19:47:14 +0000 Subject: [PATCH] Avoid an error in OnePoll when the contact was "null". --- src/Worker/OnePoll.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index 42b0d9f8c..6475cc82b 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']) {