aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-06-18 22:27:33 +0200
committerMario Vavti <mario@mariovavti.com>2023-06-18 22:27:33 +0200
commit5df9779669505f12d97988ab9560ed298675eb69 (patch)
tree1a0820c08e8db21ec00d970df779e792a88fa36c /Zotlabs/Lib
parente49d2f6b8f0dc9039b9c1435a4e2f99c783a9ab1 (diff)
downloadvolse-hubzilla-5df9779669505f12d97988ab9560ed298675eb69.tar.gz
volse-hubzilla-5df9779669505f12d97988ab9560ed298675eb69.tar.bz2
volse-hubzilla-5df9779669505f12d97988ab9560ed298675eb69.zip
make sure to use the correct url
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php11
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'], '@'))