return false;
}
- return json_decode($curlResult->getBody(), true);
+ $content = json_decode($curlResult->getBody(), true);
+
+ if (empty($content) || !is_array($content)) {
+ return false;
+ }
+
+ return $content;
}
/**
$activity['cc'] = defaults($object, 'cc', []);
$activity['actor'] = $child['author'];
$activity['object'] = $object;
- $activity['published'] = $object['published'];
+ $activity['published'] = defaults($object, 'published', $child['published']);
$activity['type'] = 'Create';
$ldactivity = JsonLD::compact($activity);