Improve display of quoted posts

This commit is contained in:
Michael 2023-07-09 14:15:01 +00:00
parent fba4a70dc2
commit e95c678141
3 changed files with 14 additions and 4 deletions

View file

@ -3217,6 +3217,12 @@ class Item
$body = BBCode::removeSharedData($body);
}
$pos = strpos($s, BBCode::SHARED_ANCHOR);
if ($pos) {
$shared_html = substr($s, $pos + strlen(BBCode::SHARED_ANCHOR));
$s = substr($s, 0, $pos);
}
$s = self::addGallery($s, $attachments, $item['uri-id']);
$s = self::addVisualAttachments($attachments, $item, $s, false);
$s = self::addLinkAttachment($item['uri-id'], $attachments, $body, $s, false, $shared_links);
@ -3237,6 +3243,10 @@ class Item
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s);
}
if (!empty($shared_html)) {
$s .= $shared_html;
}
$s = HTML::applyContentFilter($s, $filter_reasons);
$hook_data = ['item' => $item, 'html' => $s];