parse the correct kind of attachment

This commit is contained in:
Mike Macgirvin 2024-06-28 12:36:54 +10:00
parent 1e7d61af9c
commit 4b1fd36e86

View file

@ -4685,14 +4685,12 @@ class Activity
$item['body'] .= "\n\n" . '[audio]' . $a['href'] . '[/audio]';
}
}
if (array_key_exists('type', $a) && stripos($a['type'], 'link') !== false) {
if (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'];
} else {
$item['body'] .= "\n\n" . $a['href'];
}
if (!isset($a['type']) && 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'];
} else {
$item['body'] .= "\n\n" . $a['href'];
}
}