mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Replace loose comparison with casting to boolean.
In any case AuthComponent::user() returns null not empty array when user isn't logged in.
This commit is contained in:
parent
974ac44fb4
commit
a7c751922d
1 changed files with 1 additions and 1 deletions
|
@ -745,7 +745,7 @@ class AuthComponent extends Component {
|
|||
* @return boolean true if the user is logged in, false otherwise
|
||||
*/
|
||||
public function loggedIn() {
|
||||
return $this->user() != array();
|
||||
return (boolean)$this->user();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue