mirror of
https://github.com/friendica/friendica
synced 2024-11-18 21:03:41 +00:00
Negative numbers in following is a thing too
Check & sanitize 'following' as well, as per: https://mastodon.social/@BLUW
This commit is contained in:
parent
f16b1df83f
commit
a0107be2af
1 changed files with 5 additions and 0 deletions
|
@ -266,6 +266,11 @@ class APContact
|
||||||
if (!empty($apcontact['following'])) {
|
if (!empty($apcontact['following'])) {
|
||||||
$following = ActivityPub::fetchContent($apcontact['following']);
|
$following = ActivityPub::fetchContent($apcontact['following']);
|
||||||
if (!empty($following['totalItems'])) {
|
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'];
|
$apcontact['following_count'] = $following['totalItems'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue