From f3c24172f34587182adcb721bc4a941e49340973 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 18 Oct 2020 19:59:04 -0700 Subject: [PATCH] handle learnawesome's actor avatar - which is unexpectedly an array of HTTP urls with one element. --- Zotlabs/Lib/Activity.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 547f8508d..442d37075 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1705,8 +1705,14 @@ class Activity { if (is_array($person_obj['icon'])) { if (array_key_exists('url',$person_obj['icon'])) $icon = $person_obj['icon']['url']; - else - $icon = $person_obj['icon'][0]['url']; + else { + if (is_string($person_obj['icon'][0])) { + $icon = $person_obj['icon'][0]; + } + elseif (array_key_exists('url',$person_obj['icon'][0])) { + $icon = $person_obj['icon'][0]['url']; + } + } } else $icon = $person_obj['icon'];