Merge pull request #11092 from MrPetovan/bug/11091-ap-logging

Suppress Type error exception in ActivityPub\Processor
This commit is contained in:
Michael Vogel 2021-12-13 20:28:40 +01:00 committed by GitHub
commit 9db339dd9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@ use Friendica\Content\Text\HTML;
use Friendica\Content\Text\Markdown; use Friendica\Content\Text\Markdown;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\APContact; use Friendica\Model\APContact;
@ -287,8 +288,12 @@ class Processor
$item['uri'] = $activity['id']; $item['uri'] = $activity['id'];
$item['created'] = DateTimeFormat::utc($activity['published']); if (empty($activity['published']) || empty($activity['updated'])) {
$item['edited'] = DateTimeFormat::utc($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']); $guid = $activity['sc:identifier'] ?: self::getGUIDByURL($item['uri']);
$item['guid'] = $activity['diaspora:guid'] ?: $guid; $item['guid'] = $activity['diaspora:guid'] ?: $guid;