From f1f13db24fbeb9caa8d16bf4cdc858d7a3455456 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 20:48:47 +0000 Subject: [PATCH] Simplified code --- src/Content/Item.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 7a86135f9f..1b07c5585c 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -672,11 +672,8 @@ class Item // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { - if (!empty($shared['guid'])) { - $encaspulated_share = self::createSharedPostByGuid($shared['guid']); - if (!empty($encaspulated_share)) { - $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); - } + if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { + $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); } $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB));