From 13efe0eff033234546479b0e322b94b940570de4 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 11 Dec 2021 10:17:34 -0500 Subject: [PATCH] Add logging for unexpected empty published key in activity --- src/Protocol/ActivityPub/Processor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 6fc81bebe..04d05def8 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -26,6 +26,7 @@ use Friendica\Content\Text\HTML; use Friendica\Content\Text\Markdown; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\APContact; @@ -287,6 +288,10 @@ class Processor $item['uri'] = $activity['id']; + if (empty($activity['published']) || empty($activity['updated'])) { + DI::logger()->notice('published or updated keys are empty for activity', ['activity' => $activity, 'callstack' => System::callstack(10)]); + } + $item['created'] = DateTimeFormat::utc($activity['published'] ?? 'now'); $item['edited'] = DateTimeFormat::utc($activity['updated'] ?? 'now'); $guid = $activity['sc:identifier'] ?: self::getGUIDByURL($item['uri']);