Adjust where the code is to avoid empty warning
Shifted the code to avoid: PHP Warning: Undefined array key "totalItems" in /home/friendicadev/friendica/src/Model/APContact.php on line 277
This commit is contained in:
parent
c1db1c980e
commit
f16b1df83f
|
@ -272,12 +272,12 @@ class APContact
|
|||
|
||||
if (!empty($apcontact['followers'])) {
|
||||
$followers = ActivityPub::fetchContent($apcontact['followers']);
|
||||
if (!empty($followers['totalItems'])) {
|
||||
// Mastodon seriously allows for this condition?
|
||||
// Jul 14 2021 - See https://mastodon.online/@goes11 for a negative followers count
|
||||
if ($followers['totalItems'] < 0) {
|
||||
$followers['totalItems'] = 0;
|
||||
}
|
||||
if (!empty($followers['totalItems'])) {
|
||||
$apcontact['followers_count'] = $followers['totalItems'];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user