Merge pull request #12213 from Schnoop/bugfix/NodeInfo

Fix that users property should be an object instead of array.
pull/12214/head
Hypolite Petovan 2022-11-19 11:59:33 -05:00 zatwierdzone przez GitHub
commit 3d5b81e4ef
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 7 usunięć

Wyświetl plik

@ -80,19 +80,17 @@ class Nodeinfo
$config = DI::config();
$usage = new stdClass();
$usage->users = [];
$usage->users = new \stdClass;
if (!empty($config->get('system', 'nodeinfo'))) {
$usage->users = [
'total' => intval($config->get('nodeinfo', 'total_users')),
'activeHalfyear' => intval($config->get('nodeinfo', 'active_users_halfyear')),
'activeMonth' => intval($config->get('nodeinfo', 'active_users_monthly'))
];
$usage->users->total = intval($config->get('nodeinfo', 'total_users'));
$usage->users->activeHalfyear = intval($config->get('nodeinfo', 'active_users_halfyear'));
$usage->users->activeMonth = intval($config->get('nodeinfo', 'active_users_monthly'));
$usage->localPosts = intval($config->get('nodeinfo', 'local_posts'));
$usage->localComments = intval($config->get('nodeinfo', 'local_comments'));
if ($version2) {
$usage->users['activeWeek'] = intval($config->get('nodeinfo', 'active_users_weekly'));
$usage->users->activeWeek = intval($config->get('nodeinfo', 'active_users_weekly'));
}
}