mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:55:15 +00:00
slight improvements in handling empty objects
This commit is contained in:
parent
4aabd68c61
commit
ad487eefe7
3 changed files with 6 additions and 5 deletions
|
@ -2763,7 +2763,7 @@ class Activity
|
|||
|
||||
if (is_string($act->obj)) {
|
||||
// Object was unfetchable.
|
||||
return false;
|
||||
// return false;
|
||||
}
|
||||
|
||||
if (is_array($act->obj)) {
|
||||
|
@ -3057,8 +3057,9 @@ class Activity
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$s['obj_type'] = self::activity_obj_mapper($act->obj['type']);
|
||||
if (is_array($act->obj)) {
|
||||
$s['obj_type'] = self::activity_obj_mapper($act->obj['type']);
|
||||
}
|
||||
$s['obj'] = $act->obj;
|
||||
if (is_array($s['obj']) && array_path_exists('actor/id', $s['obj'])) {
|
||||
$s['obj']['actor'] = $s['obj']['actor']['id'];
|
||||
|
|
|
@ -2305,7 +2305,7 @@ class Libzot
|
|||
}
|
||||
}
|
||||
|
||||
if ($AS->obj['actor'] && $AS->obj['actor']['id'] && $AS->obj['actor']['id'] !== $AS->actor['id']) {
|
||||
if (array_path_exists('actor/id', $AS->obj) && $AS->obj['actor']['id'] !== $AS->actor['id']) {
|
||||
$y = import_author_xchan(['url' => $AS->obj['actor']['id']]);
|
||||
if (!$y) {
|
||||
logger('FOF Activity: no object actor');
|
||||
|
|
|
@ -4056,7 +4056,7 @@ function print_val($v, $escape = true)
|
|||
function array_path_exists($str, $arr)
|
||||
{
|
||||
|
||||
if (! ($arr && is_array($arr))) {
|
||||
if (! (isset($arr) && is_array($arr))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue