diff --git a/libraries/joomla/user/user.php b/libraries/joomla/user/user.php index 58b88dd6a5e59..af2dc31e2fc0c 100644 --- a/libraries/joomla/user/user.php +++ b/libraries/joomla/user/user.php @@ -264,6 +264,13 @@ public static function getInstance($identifier = 0) $id = $identifier; } + // If the $id is zero, just return an empty JUser. + // Note: don't cache this user because it'll have a new ID on save! + if ($id === 0) + { + return new JUser; + } + if (empty(self::$instances[$id])) { $user = new JUser($id);