From 5c3770e64683e593b2be43ba2926e6fc5f094c63 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 7 Jun 2021 14:09:30 -0700 Subject: [PATCH 1/2] array is null issue with guest posted photos --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index e86173523..e7d83beb6 100644 --- a/include/text.php +++ b/include/text.php @@ -1704,7 +1704,7 @@ function prepare_body(&$item,$attach = false,$opts = false) { $object = json_decode($item['obj'],true); $ptr = null; - if (array_key_exists('url',$object) && is_array($object['url'])) { + if (is_array($object) && array_key_exists('url',$object) && is_array($object['url'])) { if (array_key_exists(0,$object['url'])) { foreach ($object['url'] as $link) { if(array_key_exists('width',$link) && $link['width'] >= 640 && $link['width'] <= 1024) { From e0d3ce092522991e37dc864090d673c9bf2aa710 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 7 Jun 2021 14:35:21 -0700 Subject: [PATCH 2/2] include some objects in embedded share group posts, just not notes/articles. --- include/items.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 7b245206e..8280098b9 100644 --- a/include/items.php +++ b/include/items.php @@ -3090,7 +3090,13 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false $bb .= "[/share]"; $arr['body'] = $bb; - + // Conversational objects shouldn't be copied, but other objects should. We'll start with photos and events since those are the most likely. + if (in_array($item['obj_type'], [ 'Image', 'Event' ])) { + $arr['obj'] = $item['obj']; + } + $arr['tgt_type'] = $item['tgt_type']; + $arr['target'] = $item['target']; + $arr['term'] = $item['term']; $arr['author_xchan'] = $channel['channel_hash'];