Merge pull request #2366 from annando/1602-array_merge

Avoid "array_merge" warning.
This commit is contained in:
Tobias Diekershoff 2016-02-18 07:50:43 +01:00
commit 26463d92da

View file

@ -438,44 +438,47 @@ function poco_last_updated($profile, $force = false) {
$noscrape = json_decode($noscraperet["body"], true); $noscrape = json_decode($noscraperet["body"], true);
$contact = array("url" => $profile, if (is_array($noscrape)) {
"network" => $server[0]["network"], $contact = array("url" => $profile,
"generation" => $gcontacts[0]["generation"]); "network" => $server[0]["network"],
"generation" => $gcontacts[0]["generation"]);
$contact["name"] = $noscrape["fn"]; $contact["name"] = $noscrape["fn"];
$contact["community"] = $noscrape["comm"]; $contact["community"] = $noscrape["comm"];
if (isset($noscrape["tags"])) { if (isset($noscrape["tags"])) {
$keywords = implode(" ", $noscrape["tags"]); $keywords = implode(" ", $noscrape["tags"]);
if ($keywords != "") if ($keywords != "")
$contact["keywords"] = $keywords; $contact["keywords"] = $keywords;
}
$location = formatted_location($noscrape);
if ($location)
$contact["location"] = $location;
$contact["notify"] = $noscrape["dfrn-notify"];
// Remove all fields that are not present in the gcontact table
unset($noscrape["fn"]);
unset($noscrape["key"]);
unset($noscrape["homepage"]);
unset($noscrape["comm"]);
unset($noscrape["tags"]);
unset($noscrape["locality"]);
unset($noscrape["region"]);
unset($noscrape["country-name"]);
unset($noscrape["contacts"]);
unset($noscrape["dfrn-request"]);
unset($noscrape["dfrn-confirm"]);
unset($noscrape["dfrn-notify"]);
unset($noscrape["dfrn-poll"]);
$contact = array_merge($contact, $noscrape);
update_gcontact($contact);
return $noscrape["updated"];
} }
$location = formatted_location($noscrape);
if ($location)
$contact["location"] = $location;
$contact["notify"] = $noscrape["dfrn-notify"];
// Remove all fields that are not present in the gcontact table
unset($noscrape["fn"]);
unset($noscrape["key"]);
unset($noscrape["homepage"]);
unset($noscrape["comm"]);
unset($noscrape["tags"]);
unset($noscrape["locality"]);
unset($noscrape["region"]);
unset($noscrape["country-name"]);
unset($noscrape["contacts"]);
unset($noscrape["dfrn-request"]);
unset($noscrape["dfrn-confirm"]);
unset($noscrape["dfrn-notify"]);
unset($noscrape["dfrn-poll"]);
$contact = array_merge($contact, $noscrape);
update_gcontact($contact);
return $noscrape["updated"];
} }
} }
} }