From: Michael Date: Sun, 12 Sep 2021 01:58:29 +0000 (+0000) Subject: Use post type "photo" for multiple photos as well X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6579a3a1063b0f08d676d34e3ce43374d730d816;p=friendica.git Use post type "photo" for multiple photos as well --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 5a2b966dd5..7319aeee85 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -327,8 +327,13 @@ class BBCode } } } elseif (count($pictures) > 0) { - $post['type'] = 'link'; - $post['url'] = $plink; + if (count($pictures) > 4) { + $post['type'] = 'link'; + $post['url'] = $plink; + } else { + $post['type'] = 'photo'; + } + $post['image'] = $pictures[0][2]; $post['text'] = $body;