Check & sanitize 'following' as well, as per:
https://mastodon.social/@BLUW
if (!empty($apcontact['following'])) {
$following = ActivityPub::fetchContent($apcontact['following']);
if (!empty($following['totalItems'])) {
+ // Mastodon seriously allows for this condition?
+ // Jul 14 2021 - See https://mastodon.social/@BLUW for a negative following count
+ if ($following['totalItems'] < 0) {
+ $following['totalItems'] = 0;
+ }
$apcontact['following_count'] = $following['totalItems'];
}
}