Merge pull request #9552 from annando/zero-user
Avoid problems with uid=0
This commit is contained in:
@@ -166,7 +166,7 @@ class Profile
|
||||
}
|
||||
}
|
||||
|
||||
$profile = User::getOwnerDataById($user['uid'], false);
|
||||
$profile = !empty($user['uid']) ? User::getOwnerDataById($user['uid'], false) : [];
|
||||
|
||||
if (empty($profile) && empty($profiledata)) {
|
||||
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
|
||||
|
||||
@@ -264,7 +264,7 @@ class User
|
||||
*/
|
||||
public static function getById($uid, array $fields = [])
|
||||
{
|
||||
return DBA::selectFirst('user', $fields, ['uid' => $uid]);
|
||||
return !empty($uid) ? DBA::selectFirst('user', $fields, ['uid' => $uid]) : [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user