From 01f8cb698d9e94f442ae4aa53b92127bb088c458 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 10 May 2023 18:38:43 +0000 Subject: check if we have a type and a href --- Zotlabs/Lib/Activity.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 9f957c988..81a199cb2 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -622,6 +622,10 @@ class Activity { $atts = ((is_array($item['attach'])) ? $item['attach'] : json_decode($item['attach'], true)); if ($atts) { foreach ($atts as $att) { + if (!isset($att['type'], $att['href'])) { + continue; + } + if (isset($att['type']) && strpos($att['type'], 'image')) { $ret[] = ['type' => 'Image', 'url' => $att['href']]; } -- cgit v1.2.3