diff --git a/Code/Lib/Activity.php b/Code/Lib/Activity.php index 0be40cf66..5c9a0063a 100644 --- a/Code/Lib/Activity.php +++ b/Code/Lib/Activity.php @@ -3014,7 +3014,7 @@ class Activity in_array($act->type, ['Follow', 'Accept', 'Reject', 'Create', 'Update']) && ($act->objprop('type') === 'Follow' || ActivityStreams::is_an_actor($act->objprop('type'))) ) { - return false; + return []; } // Within our family of projects, Follow/Unfollow of a thread is an internal activity which should not be transmitted, @@ -3022,14 +3022,14 @@ class Activity // This may have to be revisited if AP projects start using Follow for objects other than actors. if (in_array($act->type, [ACTIVITY_FOLLOW, ACTIVITY_IGNORE])) { - return false; + return []; } // Do not proceed further if there is no actor. if (!isset($act->actor['id'])) { logger('No actor!'); - return false; + return []; } $item['owner_xchan'] = $act->actor['id']; @@ -3043,7 +3043,7 @@ class Activity // Do not continue without a message-id. if (!$item['mid']) { - return false; + return []; } // Translate event urls to internal items. @@ -3088,7 +3088,7 @@ class Activity // scrobblers and seem to only put noise into your stream and then vanish abruptly. if ($item['expires'] > NULL_DATE && $item['expires'] < Time::convert(datetime: 'now + 15 minutes')) { // We shouldn't even be seeing this activity. - return false; + return []; } @@ -3139,7 +3139,7 @@ class Activity // Seen in the wild with a post from jasonrobinson.me being liked by a Friendica account. if (! is_string($item['parent_mid'])) { - return false; + return []; } $item['parent_mid'] = reverse_activity_mid($item['parent_mid']); @@ -3171,7 +3171,7 @@ class Activity $obj_actor = Activity::fetch($obj_actor); } if (! is_array($obj_actor)) { - return false; + return []; } // We already check for admin blocks of third-party objects when fetching them explicitly. @@ -3181,11 +3181,11 @@ class Activity $parsed = parse_url($obj_actor['id']); if ($parsed && $parsed['scheme'] && $parsed['host']) { if (!check_siteallowed($parsed['scheme'] . '://' . $parsed['host'])) { - return false; + return []; } } if (!check_channelallowed($obj_actor['id'])) { - return false; + return []; } } diff --git a/Code/Lib/Libzot.php b/Code/Lib/Libzot.php index fc6501b98..c782c36e7 100644 --- a/Code/Lib/Libzot.php +++ b/Code/Lib/Libzot.php @@ -2234,6 +2234,9 @@ class Libzot continue; } $arr = Activity::decode_note($AS); + if (!$arr) { + continue; + } $r = hubloc_id_query($AS->actor['id'], 1); diff --git a/include/photo_factory.php b/include/photo_factory.php index 421d910ea..306484498 100644 --- a/include/photo_factory.php +++ b/include/photo_factory.php @@ -41,15 +41,6 @@ function photo_factory($data, $type = null) if (class_exists('Imagick') && !$ignore_imagick) { $ph = new PhotoImagick($data, $type); - - // As of August 2020, webp support is still poor in both imagick and gd. Both claim to support it, - // but both may require additional configuration. If it's a webp and the imagick driver failed, - // we'll try again with GD just in case that one handles it. If not, you may need to install libwebp - // which should make imagick work and/or re-compile php-gd with the option to include that library. - - if (! $ph->is_valid() && $type === 'image/webp') { - $ph = null; - } } if (! $ph) {