From 999ef7f6793f790aefdf8a40e1b0c5cb30b9be7e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 18 Apr 2016 12:13:54 +0200 Subject: [PATCH] Attachments: Better handling of preview pictures --- include/plaintext.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/include/plaintext.php b/include/plaintext.php index a6738ca93b..a4f6b6bf68 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -1,4 +1,7 @@ = 500) AND ($picturedata[0] >= $picturedata[1])) + $post["image"] = $matches[1]; + else + $post["preview"] = $matches[1]; + } if (preg_match("/\[bookmark\=([$URLSearchString]*)\](.*?)\[\/bookmark\]/ism", $attacheddata, $matches)) { $post["url"] = $matches[1]; @@ -144,9 +154,7 @@ function get_attachment_data($body) { $preview = $matches[1]; } - if (($image == "") AND ($preview != "")) - $data["image"] = $preview; - else + if ($preview != "") $data["preview"] = $preview; $data["description"] = trim($match[3]);