]> git.mxchange.org Git - friendica.git/commitdiff
Fill "last-item" with an empty date when bo date had been provided
authorMichael <heluecht@pirati.ca>
Wed, 5 Aug 2020 08:06:47 +0000 (08:06 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 5 Aug 2020 08:06:47 +0000 (08:06 +0000)
src/Model/Contact.php

index 39c955d74a38d382a4c8c02945bb1ad7d8f9e232..934c628d8e276204caf4319d0378af1afc9a1fb8 100644 (file)
@@ -1218,11 +1218,11 @@ class Contact
                }
 
                // Take the default values when probing failed
-               if (!empty($default) && !in_array($data["network"], array_merge(Protocol::NATIVE_SUPPORT, [Protocol::PUMPIO]))) {
+               if (!empty($default) && (empty($data['network']) || !in_array($data["network"], array_merge(Protocol::NATIVE_SUPPORT, [Protocol::PUMPIO])))) {
                        $data = array_merge($data, $default);
                }
 
-               if (empty($data) || ($data['network'] == Protocol::PHANTOM)) {
+               if (empty($data['network']) || ($data['network'] == Protocol::PHANTOM)) {
                        Logger::info('No valid network found', ['url' => $url, 'data' => $data, 'callstack' => System::callstack(20)]);
                        return 0;
                }
@@ -1267,7 +1267,7 @@ class Contact
                                'poco'      => $data['poco'] ?? '',
                                'baseurl'   => $data['baseurl'] ?? '',
                                'gsid'      => $data['gsid'] ?? null,
-                               'last-item' => $data['last-item'],
+                               'last-item' => $data['last-item'] ?: DBA::NULL_DATETIME,
                                'name-date' => DateTimeFormat::utcNow(),
                                'uri-date'  => DateTimeFormat::utcNow(),
                                'avatar-date' => DateTimeFormat::utcNow(),