From 41fd5bef137fa2e2f52f6d7c07279f6d5f2334cd Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 22 Jul 2018 12:45:24 -0400 Subject: [PATCH] Fix by reference notice in Protocol\PortableContact --- src/Protocol/PortableContact.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index f1d878f5d6..7e4a94706a 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -1681,25 +1681,25 @@ class PortableContact } foreach ($data->entry as $entry) { - $username = ""; + $username = ''; if (isset($entry->urls)) { foreach ($entry->urls as $url) { if ($url->type == 'profile') { $profile_url = $url->value; - $urlparts = parse_url($profile_url); - $username = end(explode("/", $urlparts["path"])); + $path_array = explode('/', parse_url($profile_url, PHP_URL_PATH)); + $username = end($path_array); } } } - if ($username != "") { - logger("Fetch contacts for the user ".$username." from the server ".$server["nurl"], LOGGER_DEBUG); + if ($username != '') { + 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 - $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); - if ($retdata["success"]) { - self::discoverServer(json_decode($retdata["body"]), 3); + if ($retdata['success']) { + self::discoverServer(json_decode($retdata['body']), 3); } } }