mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:55:18 +00:00
This should display link attachments now.
This commit is contained in:
parent
27ac124c59
commit
875b877763
1 changed files with 2 additions and 3 deletions
|
@ -4839,8 +4839,7 @@ class Activity
|
|||
if (array_key_exists('type', $a) && stripos($a['type'], 'video') !== false) {
|
||||
if (self::media_not_in_body($a['href'], $item['body'])) {
|
||||
if (isset($a['name']) && $a['name']) {
|
||||
$alt = htmlspecialchars($a['name'], ENT_QUOTES, 'UTF-8', false);
|
||||
$alt = str_replace(['[', ']'], ['[', ']'], $alt);
|
||||
$alt = str_replace(['[', ']', '\\"', '\"', '"', '"'], ['[', ']', '"', '"', '"', '"'], $a['name']); $alt = htmlspecialchars($alt, ENT_QUOTES, 'UTF-8', false);
|
||||
$item['body'] .= "\n\n" . '[video title="' . $alt . '"]' . $a['href'] . '[/video]';
|
||||
} else {
|
||||
$item['body'] .= "\n\n" . '[video]' . $a['href'] . '[/video]';
|
||||
|
@ -4852,7 +4851,7 @@ class Activity
|
|||
$item['body'] .= "\n\n" . '[audio]' . $a['href'] . '[/audio]';
|
||||
}
|
||||
}
|
||||
if (!isset($a['type']) && ActivityStreams::is_url($a['href']) && !strpos($item['body'], $a['href'])) {
|
||||
if ((!isset($a['type']) || $a['type'] === 'Link') && ActivityStreams::is_url($a['href']) && !strpos($item['body'], $a['href'])) {
|
||||
$li = Url::get(z_root() . '/linkinfo?binurl=' . bin2hex($a['href']));
|
||||
if ($li['success'] && $li['body']) {
|
||||
$item['body'] .= "\n" . $li['body'];
|
||||
|
|
Loading…
Reference in a new issue