From 75894fa275f6728b0a4c54a2555fe76f4df84073 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 15 Jun 2019 17:11:01 -0400 Subject: [PATCH 1/3] Use item created date if edited doesn't exist in Protocol\Diaspora::buildStatus - Addresses https://github.com/friendica/friendica/issues/6918#issuecomment-502347886 --- src/Protocol/Diaspora.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 751033e96..f7d94256e 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -3543,7 +3543,7 @@ class Diaspora $public = ($item["private"] ? "false" : "true"); $created = DateTimeFormat::utc($item["created"], DateTimeFormat::ATOM); - $edited = DateTimeFormat::utc($item["edited"], DateTimeFormat::ATOM); + $edited = DateTimeFormat::utc($item["edited"] ?? $item["created"], DateTimeFormat::ATOM); // Detect a share element and do a reshare if (!$item['private'] && ($ret = self::isReshare($item["body"]))) { From aa5a61baefce2e54bd080de0a0e0c140b0098c3b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 15 Jun 2019 17:12:36 -0400 Subject: [PATCH 2/3] Fix variable by reference notice in Module\Admin\Federation - Addresses https://github.com/friendica/friendica/issues/6918#issuecomment-502347979 --- src/Module/Admin/Federation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 9c52845b9..8776f21e1 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -88,7 +88,7 @@ class Federation extends BaseAdminModule } while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3))); // only take the x.x.x part of the version, not the "release" after the dash if (!empty($part) && strpos($part, '-')) { - $part = array_shift(explode('-', $part)); + $part = explode('-', $part)[0]; } if (!empty($part)) { if (empty($compacted[$part])) { From 14725bbd6aca29c2c6442936bfcb37f9c743c96a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 15 Jun 2019 17:16:10 -0400 Subject: [PATCH 3/3] Fix undefined index addr notices in Model\Contact::getIdForURL - Addresses https://github.com/friendica/friendica/issues/6918#issuecomment-502393030 --- src/Model/Contact.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 01bbd23a6..a7914a190 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1463,12 +1463,14 @@ class Contact extends BaseObject return $contact_id; } - $updated = ['addr' => $data['addr'], + $updated = [ + 'addr' => $data['addr'] ?? '', 'alias' => defaults($data, 'alias', ''), 'url' => $data['url'], 'nurl' => Strings::normaliseLink($data['url']), 'name' => $data['name'], - 'nick' => $data['nick']]; + 'nick' => $data['nick'] + ]; if (!empty($data['keywords'])) { $updated['keywords'] = $data['keywords']; @@ -1502,7 +1504,7 @@ class Contact extends BaseObject $updated['pubkey'] = $data['pubkey']; } - if (($data['addr'] != $contact['addr']) || (!empty($data['alias']) && ($data['alias'] != $contact['alias']))) { + if (($updated['addr'] != $contact['addr']) || (!empty($data['alias']) && ($data['alias'] != $contact['alias']))) { $updated['uri-date'] = DateTimeFormat::utcNow(); } if (($data["name"] != $contact["name"]) || ($data["nick"] != $contact["nick"])) {