From 9ed24ff6d486a11b59f64091d99644d4e3055a3d Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 31 Jul 2019 22:51:33 -0700 Subject: [PATCH] better handling of photo linked items when author is censored --- include/text.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/text.php b/include/text.php index 23295c912..44c056e95 100644 --- a/include/text.php +++ b/include/text.php @@ -1510,16 +1510,16 @@ function prepare_body(&$item,$attach = false,$opts = false) { $object = json_decode($item['obj'],true); if(array_key_exists('url',$object) && is_array($object['url']) && array_key_exists(0,$object['url'])) { - // if original photo width is <= 640px prepend it to item body - if(array_key_exists('width',$object['url'][0]) && $object['url'][0]['width'] <= 640) { - $item['body'] = '[zmg]' . $object['url'][0]['href'] . '[/zmg]' . "\n\n" . $item['body']; - } - // if original photo width is > 640px make it a cover photo if(array_key_exists('width',$object['url'][0]) && $object['url'][0]['width'] > 640) { $scale = ((($object['url'][1]['width'] == 1024) || ($object['url'][1]['height'] == 1024)) ? 1 : 0); $photo = ''; } + // if original photo width is <= 640px prepend it to item body + elseif(array_key_exists('width',$object['url'][0]) && $object['url'][0]['width'] <= 640) { + $item['body'] = '[zmg]' . $object['url'][0]['href'] . '[/zmg]' . "\n\n" . $item['body']; + } + } }