X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FItem.php;h=f7dda6c65f4030c24de79e24e645009a90ae3e1b;hb=8bb33dccd1d945c849c7006ee56a73fc9404323c;hp=bd3c6d774b8d55abe702604c3c7176f4a75a7c16;hpb=9678618dd42ea1877d24db683ef79b3b09817584;p=friendica.git diff --git a/src/Content/Item.php b/src/Content/Item.php index bd3c6d774b..f7dda6c65f 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -669,14 +669,15 @@ class Item * Add a share block for the given item array * * @param array $item - * @param bool $add_media + * @param bool $add_media true = Media is added to the body + * @param bool $for_display true = The share block is used for display purposes, false = used for connectors, transport to other systems, ... * @return string */ - public function createSharedBlockByArray(array $item, bool $add_media = false): string + public function createSharedBlockByArray(array $item, bool $add_media = false, bool $for_display = false): string { if ($item['network'] == Protocol::FEED) { return PageInfo::getFooterFromUrl($item['plink']); - } elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { + } elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED) && !$for_display) { $item['guid'] = ''; $item['uri'] = ''; } @@ -695,7 +696,7 @@ class Item // If it is a reshared post then reformat it to avoid display problems with two share elements if (!empty($shared)) { - if (!empty($shared['guid']) && ($encapsulated_share = $this->createSharedPostByGuid($shared['guid'], true))) { + if (($item['network'] != Protocol::BLUESKY) && !empty($shared['guid']) && ($encapsulated_share = $this->createSharedPostByGuid($shared['guid'], true))) { if (!empty(BBCode::fetchShareAttributes($item['body']))) { $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encapsulated_share, $item['body']); } else {