diff options
-rw-r--r-- | Zotlabs/Lib/Activity.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 0e044b355..79821badc 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1054,15 +1054,18 @@ class Activity { static function encode_person($p, $extended = true) { - if (!$p['xchan_url']) - return []; + $id = ((filter_var($p['xchan_hash'], FILTER_VALIDATE_URL)) ? $p['xchan_hash'] : $p['xchan_url']); if (!$extended) { - return $p['xchan_url']; + return $id; } $ret = []; + if (!$id) { + return $ret; + } + $c = ((array_key_exists('channel_id', $p)) ? $p : channelx_by_hash($p['xchan_hash'])); $ret['type'] = 'Person'; @@ -1079,7 +1082,7 @@ class Activity { $ret['id'] = channel_url($c); } else { - $ret['id'] = ((strpos($p['xchan_hash'], 'http') === 0) ? $p['xchan_hash'] : $p['xchan_url']); + $ret['id'] = $id; } if ($p['xchan_addr'] && strpos($p['xchan_addr'], '@')) |