]> git.mxchange.org Git - friendica.git/commitdiff
Set "hide" in noscrape
authorMichael Vogel <icarus@dabo.de>
Wed, 4 May 2016 21:50:31 +0000 (23:50 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 4 May 2016 21:50:31 +0000 (23:50 +0200)
include/socgraph.php
mod/noscrape.php

index 07418a7177f5498bd2880c19a15b1750831e8056..a43d710fbd2a55d87d1d4b86b0b0a92a6fc9a988 100644 (file)
@@ -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"]);
index 4be1a740cd87b6eaaa4d135c256ad6b11d77bb80..42931cf382bbab2319ce1b21c23443879300e523 100644 (file)
@@ -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);