mirror of
https://github.com/friendica/friendica
synced 2024-11-18 20:23:44 +00:00
Fix attached media in quoted posts
This commit is contained in:
parent
04564f0320
commit
68d6e11d83
1 changed files with 11 additions and 0 deletions
|
@ -666,8 +666,19 @@ class Item
|
||||||
$shared_content .= '[h3]' . $item['title'] . "[/h3]\n";
|
$shared_content .= '[h3]' . $item['title'] . "[/h3]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$shared = BBCode::fetchShareAttributes($item['body']);
|
||||||
|
|
||||||
|
$item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']);
|
||||||
|
|
||||||
// If it is a reshared post then reformat it to avoid display problems with two share elements
|
// If it is a reshared post then reformat it to avoid display problems with two share elements
|
||||||
if (Diaspora::isReshare($item['body'], false)) {
|
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']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB));
|
$item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue