X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FGContact.php;h=99660ba60283ff80a78cd138c0ba0d63e315e659;hb=0360f7197aac062eb2fecf95969658ca56068deb;hp=48843533119150e72ad46fd433888cbed86e6d55;hpb=32ef5623ab8247162af93ef2f0bc6def6b2b8bf6;p=friendica.git diff --git a/src/Model/GContact.php b/src/Model/GContact.php index 4884353311..99660ba602 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -787,11 +787,11 @@ class GContact // Bugfix: We had an error in the storing of keywords which lead to the "0" // This value is still transmitted via poco. - if ($contact["keywords"] == "0") { + if (!empty($contact["keywords"]) && ($contact["keywords"] == "0")) { unset($contact["keywords"]); } - if ($public_contact[0]["keywords"] == "0") { + if (!empty($public_contact[0]["keywords"]) && ($public_contact[0]["keywords"] == "0")) { $public_contact[0]["keywords"] = ""; } @@ -996,7 +996,7 @@ class GContact $statistics = json_decode($result["body"]); - if (is_object($statistics->config)) { + if (!empty($statistics->config)) { if ($statistics->config->instance_with_ssl) { $server = "https://"; } else { @@ -1006,8 +1006,7 @@ class GContact $server .= $statistics->config->instance_address; $hostname = $statistics->config->instance_address; - } else { - /// @TODO is_object() above means here no object, still $statistics is being used as object + } elseif (!empty($statistics)) { if ($statistics->instance_with_ssl) { $server = "https://"; } else { @@ -1019,7 +1018,7 @@ class GContact $hostname = $statistics->instance_address; } - if (is_object($statistics->users)) { + if (!empty($statistics->users)) { foreach ($statistics->users as $nick => $user) { $profile_url = $server."/".$user->nickname; @@ -1027,9 +1026,13 @@ class GContact "name" => $user->fullname, "addr" => $user->nickname."@".$hostname, "nick" => $user->nickname, - "about" => $user->bio, "network" => NETWORK_OSTATUS, "photo" => System::baseUrl()."/images/person-175.jpg"]; + + if (isset($user->bio)) { + $contact["about"] = $user->bio; + } + self::getId($contact); } }