]> git.mxchange.org Git - friendica.git/commitdiff
$contact isn't called by reference anymore
authorMichael <heluecht@pirati.ca>
Wed, 14 Mar 2018 20:53:03 +0000 (20:53 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 14 Mar 2018 20:53:03 +0000 (20:53 +0000)
include/items.php
src/Worker/OnePoll.php

index 31c8aaa799394dacdfaec90795523c63b325e989..b46e0d6a6214a2527ad7e446e20443af9bfedba3 100644 (file)
@@ -228,7 +228,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
  *
  * @TODO find proper type-hints
  */
-function consume_feed($xml, $importer, &$contact, &$hub, $datedir = 0, $pass = 0) {
+function consume_feed($xml, $importer, $contact, &$hub, $datedir = 0, $pass = 0) {
        if ($contact['network'] === NETWORK_OSTATUS) {
                if ($pass < 2) {
                        // Test - remove before flight
index 6475cc82b7031b09d30be8fbd4922e2bf4a720e8..c1c6fdd1a8da8b2f216044bc2b2eabdcefd60e93 100644 (file)
@@ -582,15 +582,12 @@ class OnePoll
 
                        logger("Consume feed of contact ".$contact['id']);
 
-                       // 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);
+                       consume_feed($xml, $importer, $contact, $hub);
 
-                       // do it twice. Ensures that children of parents which may be later in the stream aren't tossed
-
-                       $contact2 = $contact;
-                       consume_feed($xml, $importer, $contact2, $hub, 1, 2);
+                       // do it a second time for DFRN so that any children find their parents.
+                       if ($contact['network'] === NETWORK_DFRN) {
+                               consume_feed($xml, $importer, $contact, $hub);
+                       }
 
                        $hubmode = 'subscribe';
                        if ($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly']) {