Merge pull request #12213 from Schnoop/bugfix/NodeInfo
Fix that users property should be an object instead of array.
This commit is contained in:
commit
3d5b81e4ef
|
@ -80,19 +80,17 @@ class Nodeinfo
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
$usage = new stdClass();
|
$usage = new stdClass();
|
||||||
$usage->users = [];
|
$usage->users = new \stdClass;
|
||||||
|
|
||||||
if (!empty($config->get('system', 'nodeinfo'))) {
|
if (!empty($config->get('system', 'nodeinfo'))) {
|
||||||
$usage->users = [
|
$usage->users->total = intval($config->get('nodeinfo', 'total_users'));
|
||||||
'total' => intval($config->get('nodeinfo', 'total_users')),
|
$usage->users->activeHalfyear = intval($config->get('nodeinfo', 'active_users_halfyear'));
|
||||||
'activeHalfyear' => intval($config->get('nodeinfo', 'active_users_halfyear')),
|
$usage->users->activeMonth = intval($config->get('nodeinfo', 'active_users_monthly'));
|
||||||
'activeMonth' => intval($config->get('nodeinfo', 'active_users_monthly'))
|
|
||||||
];
|
|
||||||
$usage->localPosts = intval($config->get('nodeinfo', 'local_posts'));
|
$usage->localPosts = intval($config->get('nodeinfo', 'local_posts'));
|
||||||
$usage->localComments = intval($config->get('nodeinfo', 'local_comments'));
|
$usage->localComments = intval($config->get('nodeinfo', 'local_comments'));
|
||||||
|
|
||||||
if ($version2) {
|
if ($version2) {
|
||||||
$usage->users['activeWeek'] = intval($config->get('nodeinfo', 'active_users_weekly'));
|
$usage->users->activeWeek = intval($config->get('nodeinfo', 'active_users_weekly'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user