Permalink
Browse files

Replace loose comparison with casting to boolean.

In any case AuthComponent::user() returns null not empty array when user isn't logged in.
  • Loading branch information...
ADmad committed Feb 10, 2013
1 parent 974ac44 commit a7c751922d4a728f66bdb18d0a660ced55c88a1b
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Component/AuthComponent.php
@@ -745,7 +745,7 @@ public function shutdown(Controller $controller) {
* @return boolean true if the user is logged in, false otherwise
*/
public function loggedIn() {
- return $this->user() != array();
+ return (boolean)$this->user();
}
/**

0 comments on commit a7c7519

Please sign in to comment.