]> git.mxchange.org Git - friendica.git/commitdiff
Fix by reference notice in Protocol\PortableContact
authorHypolite Petovan <mrpetovan@gmail.com>
Sun, 22 Jul 2018 16:45:24 +0000 (12:45 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Tue, 24 Jul 2018 11:54:12 +0000 (07:54 -0400)
src/Protocol/PortableContact.php

index f1d878f5d6049b83bbca136406363d0e07e50695..7e4a94706a792d77af85289f7957d4b3db6a8b58 100644 (file)
@@ -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);
                                }
                        }
                }