From 5df9779669505f12d97988ab9560ed298675eb69 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 18 Jun 2023 22:27:33 +0200 Subject: make sure to use the correct url --- Zotlabs/Lib/Activity.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Lib') 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'], '@')) -- cgit v1.2.3