Details
-
Bug
-
Resolution: Duplicate
-
Medium
-
None
-
4.0.0
-
None
-
Operating System: Linux
PHP Version: 5.2.0-8+etch11
Database and version: MySQL 5.0.32
Description
When the instance method of the eZUser class is called with no parameters (like the currentUser method does), it creates a new instance of the current user and returns that, instead of returning an already created instance of it.
This is because the check for it having been created already comes before the check that makes it use the current user when the ID is not given. The attached patch reverses this to check the parameter first, and the cache second.
Steps to reproduce
if (eZUser::currentUser()===eZUser::currentUser()) { echo "Same instance."; } else { echo "Not same instance."; }
Attachments
Issue Links
- relates to
-
EZP-14622 role & group session cache is not correctly cleaned on login in 4.1
- Closed