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:
ADmad 2013-02-10 12:16:20 +05:30
parent 974ac44fb4
commit a7c751922d

View file

@ -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();
}
/**