X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fdiscover_poco.php;h=e71c26fc180da224e2594f2fb71a6c80b2e04809;hb=45ec3fb5d8d26c69733491394a298b37b3e93260;hp=bb53efb5ccc125b37097c0d1112338d4b7269b1e;hpb=f6ef6f0c7aef05533965fdd66263485646760fd7;p=friendica.git diff --git a/include/discover_poco.php b/include/discover_poco.php index bb53efb5cc..e71c26fc18 100644 --- a/include/discover_poco.php +++ b/include/discover_poco.php @@ -1,9 +1,10 @@ results)) { - foreach($j->results as $jj) { + foreach ($j->results as $jj) { // Check if the contact already exists $exists = q("SELECT `id`, `last_contact`, `last_failure`, `updated` FROM `gcontact` WHERE `nurl` = '%s'", normalise_link($jj->url)); - if ($exists) { + if (dbm::is_result($exists)) { logger("Profile ".$jj->url." already exists (".$search.")", LOGGER_DEBUG); if (($exists[0]["last_contact"] < $exists[0]["last_failure"]) AND @@ -272,12 +273,16 @@ function gs_search_user($search) { if (!$result["success"]) { return false; } + $contacts = json_decode($result["body"]); if ($contacts->status == 'ERROR') { return false; } - foreach($contacts->data AS $user) { + + /// @TODO AS is considered as a notation for constants (as they usually being written all upper-case) + /// @TODO find all those and convert to all lower-case which is a keyword then + foreach ($contacts->data AS $user) { $contact = probe_url($user->site_address."/".$user->name); if ($contact["network"] != NETWORK_PHANTOM) { $contact["about"] = $user->description;