From 875b8777637b2797a91f0e2c553ba963b3f7261f Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 31 Aug 2024 08:17:04 +1000 Subject: [PATCH] This should display link attachments now. --- src/Lib/Activity.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Lib/Activity.php b/src/Lib/Activity.php index a9516d525..4b233e617 100644 --- a/src/Lib/Activity.php +++ b/src/Lib/Activity.php @@ -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'];