From ed485b9d616d8f8eba765c7a6551b854eb655c1a Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 4 May 2016 23:50:31 +0200 Subject: [PATCH] Set "hide" in noscrape --- include/socgraph.php | 10 +++++++--- mod/noscrape.php | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/socgraph.php b/include/socgraph.php index 07418a7177..a43d710fbd 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -453,8 +453,11 @@ function poco_last_updated($profile, $force = false) { "network" => $server[0]["network"], "generation" => $gcontacts[0]["generation"]); - $contact["name"] = $noscrape["fn"]; - $contact["community"] = $noscrape["comm"]; + if (isset($noscrape["fn"])) + $contact["name"] = $noscrape["fn"]; + + if (isset($noscrape["comm"])) + $contact["community"] = $noscrape["comm"]; if (isset($noscrape["tags"])) { $keywords = implode(" ", $noscrape["tags"]); @@ -466,7 +469,8 @@ function poco_last_updated($profile, $force = false) { if ($location) $contact["location"] = $location; - $contact["notify"] = $noscrape["dfrn-notify"]; + if (isset($noscrape["dfrn-notify"])) + $contact["notify"] = $noscrape["dfrn-notify"]; // Remove all fields that are not present in the gcontact table unset($noscrape["fn"]); diff --git a/mod/noscrape.php b/mod/noscrape.php index 4be1a740cd..42931cf382 100644 --- a/mod/noscrape.php +++ b/mod/noscrape.php @@ -15,8 +15,12 @@ function noscrape_init(&$a) { profile_load($a,$which,$profile); - if(!$a->profile['net-publish']) + if(!$a->profile['net-publish']) { + header('Content-type: application/json; charset=utf-8'); + $json_info = array("hide" => true); + echo json_encode($json_info); killme(); + } $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : ''); $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);