mirror of
https://github.com/Pathduck/gallery3.git
synced 2024-10-29 21:07:18 -04:00
Fix active() to not use user::guest() as the fallback for our Session::get() call.
This commit is contained in:
parent
0d16cc1c10
commit
50c624ed1b
@ -159,7 +159,12 @@ class user_Core {
|
||||
*/
|
||||
static function active() {
|
||||
// @todo (maybe) cache this object so we're not always doing session lookups.
|
||||
$user = Session::instance()->get("user", self::guest());
|
||||
$user = Session::instance()->get("user", null);
|
||||
if (!isset($user)) {
|
||||
// Don't do this as a fallback in the Session::get() call because it can trigger unnecessary
|
||||
// work.
|
||||
$user = user::guest();
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user