]> git.mxchange.org Git - friendica.git/commitdiff
Add object key existence check in ActivityPub/Transmitter
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 29 Mar 2020 16:52:05 +0000 (12:52 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 29 Mar 2020 16:52:05 +0000 (12:52 -0400)
- Addresses https://github.com/friendica/friendica/issues/8000#issuecomment-605614192

src/Protocol/ActivityPub/Transmitter.php

index e39a4f95817e3a33d6378cc1b8487a23e7f58b79..837e81c1e95d93f17f64983aee7d93334eccbe62 100644 (file)
@@ -193,10 +193,10 @@ class Transmitter
                        $items = Item::select(['id'], $condition, ['limit' => [($page - 1) * 20, 20], 'order' => ['created' => true]]);
                        while ($item = Item::fetch($items)) {
                                $activity = self::createActivityFromItem($item['id'], true);
-                               $activity['type'] = $activity['type'] == 'Update' ? 'Create' : $activity['type'];
+                               $activity['type'] = $activity['type'] == 'Update' ? 'Create' : $activity['type'];
 
                                // Only list "Create" activity objects here, no reshares
-                               if (is_array($activity['object']) && ($activity['type'] == 'Create')) {
+                               if (!empty($activity['object']) && ($activity['type'] == 'Create')) {
                                        $list[] = $activity['object'];
                                }
                        }