1
1
Fork 0

Fix by reference notice in Protocol\PortableContact

This commit is contained in:
Hypolite Petovan 2018-07-22 12:45:24 -04:00
parent 4e9ba728c4
commit 41fd5bef13

View file

@ -1681,25 +1681,25 @@ class PortableContact
} }
foreach ($data->entry as $entry) { foreach ($data->entry as $entry) {
$username = ""; $username = '';
if (isset($entry->urls)) { if (isset($entry->urls)) {
foreach ($entry->urls as $url) { foreach ($entry->urls as $url) {
if ($url->type == 'profile') { if ($url->type == 'profile') {
$profile_url = $url->value; $profile_url = $url->value;
$urlparts = parse_url($profile_url); $path_array = explode('/', parse_url($profile_url, PHP_URL_PATH));
$username = end(explode("/", $urlparts["path"])); $username = end($path_array);
} }
} }
} }
if ($username != "") { if ($username != '') {
logger("Fetch contacts for the user ".$username." from the server ".$server["nurl"], LOGGER_DEBUG); logger('Fetch contacts for the user ' . $username . ' from the server ' . $server['nurl'], LOGGER_DEBUG);
// Fetch all contacts from a given user from the other server // Fetch all contacts from a given user from the other server
$url = $server["poco"]."/".$username."/?fields=displayName,urls,photos,updated,network,aboutMe,currentLocation,tags,gender,contactType,generation"; $url = $server['poco'] . '/' . $username . '/?fields=displayName,urls,photos,updated,network,aboutMe,currentLocation,tags,gender,contactType,generation';
$retdata = Network::curl($url); $retdata = Network::curl($url);
if ($retdata["success"]) { if ($retdata['success']) {
self::discoverServer(json_decode($retdata["body"]), 3); self::discoverServer(json_decode($retdata['body']), 3);
} }
} }
} }