]> git.mxchange.org Git - friendica.git/commitdiff
Added logging and one more reason for a notice found (#5538)
authorMichael Vogel <icarus@dabo.de>
Wed, 1 Aug 2018 06:47:18 +0000 (08:47 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 1 Aug 2018 06:47:18 +0000 (08:47 +0200)
* Added logging and one more reason for a notice found

* And one more

src/Network/Probe.php
src/Protocol/Diaspora.php
src/Protocol/PortableContact.php

index 1bc0f9d630b7d1c7213a0c33493fdaa65c82bcf7..8f236796a90ed30d99b4ee72124bc790e8adfde4 100644 (file)
@@ -944,6 +944,11 @@ class Probe
                $prof_data["fn"]           = $data["name"];
                $prof_data["key"]          = $data["pubkey"];
 
+               // This logging is for temporarily debugging reasons
+               if (!isset($data["poco"])) {
+                       logger('POCO not defined for ' . profile_link, LOGGER_DEBUG);
+               }
+
                logger("Result for profile ".$profile_link.": ".print_r($prof_data, true), LOGGER_DEBUG);
 
                return $prof_data;
index e463857857270420f1261317a8eca6f23239a5cf..83afa61888b4bf6ebd8bba94a8e30fc30a380c4c 100644 (file)
@@ -1374,15 +1374,12 @@ class Diaspora
                $item = Item::selectFirst($fields, $condition);
 
                if (!DBA::isResult($item)) {
-                       if (!isset($contact["url"])) {
-                               logger('Missing URL: ' . System::callstack() . ' - ' . json_encode($contact));
-                       }
-
-                       $result = self::storeByGuid($guid, $contact["url"], $uid);
+                       $person = self::personByHandle($author);
+                       $result = self::storeByGuid($guid, $person["url"], $uid);
 
-                       if (!$result) {
-                               $person = self::personByHandle($author);
-                               $result = self::storeByGuid($guid, $person["url"], $uid);
+                       // We don't have an url for items that arrived at the public dispatcher
+                       if (!$result && !empty($contact["url"])) {
+                               $result = self::storeByGuid($guid, $contact["url"], $uid);
                        }
 
                        if ($result) {
index 3183a192f79d3e84e964bd0787064f6e1041e220..aa86a0002a0f5c093bda4c812d84032221537cbf 100644 (file)
@@ -659,6 +659,10 @@ class PortableContact
                $nodeinfo2_url = '';
 
                foreach ($nodeinfo['links'] as $link) {
+                       if (!is_array($link) || empty($link['rel'])) {
+                               logger('Invalid nodeinfo format for ' . $server_url, LOGGER_DEBUG);
+                               continue;
+                       }
                        if ($link['rel'] == 'http://nodeinfo.diaspora.software/ns/schema/1.0') {
                                $nodeinfo1_url = $link['href'];
                        } elseif ($link['rel'] == 'http://nodeinfo.diaspora.software/ns/schema/2.0') {