Merge pull request #11369 from annando/empty-item

Prevent further processing of incoming posts when thay are rejected
This commit is contained in:
Hypolite Petovan 2022-03-22 08:54:20 -04:00 committed by GitHub
commit 2438eb78dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,6 +164,10 @@ class Processor
if (!DBA::isResult($item)) {
Logger::warning('No existing item, item will be created', ['uri' => $activity['id']]);
$item = self::createItem($activity);
if (empty($item)) {
return;
}
self::postItem($activity, $item);
return;
}
@ -416,6 +420,10 @@ class Processor
public static function createActivity($activity, $verb)
{
$item = self::createItem($activity);
if (empty($item)) {
return;
}
$item['verb'] = $verb;
$item['thr-parent'] = $activity['object_id'];
$item['gravity'] = GRAVITY_ACTIVITY;