Merge pull request #9055 from annando/zero-owner

Return system account data when fetching data for user "0"
This commit is contained in:
Hypolite Petovan 2020-08-23 06:42:26 -04:00 committed by GitHub
commit c259d2b454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,8 +118,8 @@ class User
}
}
$system['spubkey'] = $system['uprvkey'] = $system['prvkey'];
$system['username'] = $system['name'];
$system['sprvkey'] = $system['uprvkey'] = $system['prvkey'];
$system['spubkey'] = $system['upubkey'] = $system['pubkey'];
$system['nickname'] = $system['nick'];
return $system;
}
@ -332,6 +332,10 @@ class User
*/
public static function getOwnerDataById(int $uid, bool $check_valid = true)
{
if ($uid == 0) {
return self::getSystemAccount();
}
if (!empty(self::$owner[$uid])) {
return self::$owner[$uid];
}