Merge pull request #5952 from annando/ap-fixes
AP: Fix a notice / avoid an error when fetched content hadn't been an array
This commit is contained in:
commit
e2f005f68c
|
@ -63,7 +63,13 @@ class ActivityPub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return json_decode($curlResult->getBody(), true);
|
$content = json_decode($curlResult->getBody(), true);
|
||||||
|
|
||||||
|
if (empty($content) || !is_array($content)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -272,7 +272,7 @@ class Processor
|
||||||
$activity['cc'] = defaults($object, 'cc', []);
|
$activity['cc'] = defaults($object, 'cc', []);
|
||||||
$activity['actor'] = $child['author'];
|
$activity['actor'] = $child['author'];
|
||||||
$activity['object'] = $object;
|
$activity['object'] = $object;
|
||||||
$activity['published'] = $object['published'];
|
$activity['published'] = defaults($object, 'published', $child['published']);
|
||||||
$activity['type'] = 'Create';
|
$activity['type'] = 'Create';
|
||||||
|
|
||||||
$ldactivity = JsonLD::compact($activity);
|
$ldactivity = JsonLD::compact($activity);
|
||||||
|
|
Loading…
Reference in a new issue