From 43acb86aabdafd70354887a8ffbf836c12d9a69d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 10 Nov 2024 11:49:09 +0100 Subject: fix encoding and attribution --- include/photos.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/photos.php b/include/photos.php index fe1a500d6..390754f39 100644 --- a/include/photos.php +++ b/include/photos.php @@ -406,7 +406,7 @@ function photo_upload($channel, $observer, $args) { } } - $attribution = (($visitor) ? $visitor : $channel['xchan_url']); + $attribution = (($visitor) ? $visitor : channel_url($channel)); //// Create item object $object = [ @@ -457,7 +457,7 @@ function photo_upload($channel, $observer, $args) { $target = [ 'id' => str_replace('/item/', '/conversation/', $item['mid']), 'type' => 'Collection', - 'attributedTo' => channel_url($channel), + 'attributedTo' => $attribution, ]; $item['body'] = $summary; @@ -466,10 +466,10 @@ function photo_upload($channel, $observer, $args) { $object['id'] = $item['mid']; $object['diaspora:guid'] = $item['uuid']; - $item['obj'] = json_encode($object); + $item['obj'] = $object; $item['tgt_type'] = 'Collection'; - $item['target'] = json_encode($target); + $item['target'] = $target; if ($post_tags) { $arr['term'] = $post_tags; } @@ -513,7 +513,7 @@ function photo_upload($channel, $observer, $args) { $target = [ 'id' => z_root() . '/conversation/' . $uuid, 'type' => 'Collection', - 'attributedTo' => channel_url($channel), + 'attributedTo' => $attribution, ]; $arr = [ -- cgit v1.2.3