]> git.mxchange.org Git - friendica.git/commitdiff
Simplified code
authorMichael <heluecht@pirati.ca>
Tue, 11 Oct 2022 20:48:47 +0000 (20:48 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 11 Oct 2022 20:48:47 +0000 (20:48 +0000)
src/Content/Item.php

index 7a86135f9fe3f1755ac0b94a364d10964437015a..1b07c5585cd3fa578f5450986ee62e17e836afe5 100644 (file)
@@ -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));