From ec22b6086ada478d9effd6fc7c7be63937669ed8 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 15 Jul 2016 16:53:30 +0200 Subject: [PATCH] API: fix plaintext of reshared attachment When replacing `[attachment]` element, text after it wasn't restored. `[share]` element can contain `[attachment]`, the closing `[/share]` was elided, then the `[share]` element was shown in plaintext instead of recycle symbol --- include/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 832240f716..5512dffd35 100644 --- a/include/api.php +++ b/include/api.php @@ -3184,7 +3184,6 @@ $include_entities = strtolower(x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:"false"); $Text = bb_CleanPictureLinks($Text); - $URLSearchString = "^\[\]"; $Text = preg_replace("/([!#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",'$1$3',$Text); @@ -3223,6 +3222,8 @@ if (isset($data["url"])) $body .= "\n".$data["url"]; + $body .= $data["after"]; + return $body; } -- 2.39.5