From 6579a3a1063b0f08d676d34e3ce43374d730d816 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 12 Sep 2021 01:58:29 +0000 Subject: [PATCH] Use post type "photo" for multiple photos as well --- src/Content/Text/BBCode.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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;