Remove attachment tags before checking for end of body images
This commit is contained in:
parent
5af956b92f
commit
12df6297d7
|
@ -3016,6 +3016,8 @@ class Item
|
||||||
$item['hashtags'] = $tags['hashtags'];
|
$item['hashtags'] = $tags['hashtags'];
|
||||||
$item['mentions'] = $tags['mentions'];
|
$item['mentions'] = $tags['mentions'];
|
||||||
|
|
||||||
|
$item['body'] = preg_replace("#\s*\[attachment .*?].*?\[/attachment]\s*#ism", "\n", $item['body']);
|
||||||
|
|
||||||
if (!$is_preview) {
|
if (!$is_preview) {
|
||||||
$item['body'] = Post\Media::removeFromEndOfBody($item['body'] ?? '');
|
$item['body'] = Post\Media::removeFromEndOfBody($item['body'] ?? '');
|
||||||
}
|
}
|
||||||
|
@ -3065,8 +3067,6 @@ class Item
|
||||||
$attachments = Post\Media::splitAttachments($item['uri-id'], $shared_links, $item['has-media'] ?? false);
|
$attachments = Post\Media::splitAttachments($item['uri-id'], $shared_links, $item['has-media'] ?? false);
|
||||||
$item['body'] = self::replaceVisualAttachments($attachments, $item['body'] ?? '');
|
$item['body'] = self::replaceVisualAttachments($attachments, $item['body'] ?? '');
|
||||||
|
|
||||||
$item['body'] = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", "\n", $item['body']);
|
|
||||||
|
|
||||||
self::putInCache($item);
|
self::putInCache($item);
|
||||||
$item['body'] = $body;
|
$item['body'] = $body;
|
||||||
$s = $item["rendered-html"];
|
$s = $item["rendered-html"];
|
||||||
|
@ -3166,7 +3166,7 @@ class Item
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the body contains a link
|
* Check if the body contains a link
|
||||||
|
|
Loading…
Reference in New Issue
Block a user