* fix bug #t

This commit is contained in:
Zongjun Lan
2022-03-17 15:58:35 +08:00
parent 93760189d5
commit ad622ccb02
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -249,13 +249,16 @@ class userModel extends model
/**
* Get user info by ID.
*
* @param mix $userID
* @param string $field id|account
* @param mix $userID
* @param string $field id|account
* @access public
* @return object|bool
*/
public function getById($userID, $field = 'account')
{
/* Return current user when user is guest or empty to make sure pages in dashboard work fine. */
if(empty($userID) && $this->app->user->account == 'guest') return $this->app->user;
if($field == 'id') $userID = (int)$userID;
if($field == 'account') $userID = str_replace(' ', '', $userID);