Request the user with active user id
f.e. JFactory::getUser(308), assuming logged in user's id is 308
below condition must be false
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/factory.php#L246
elseif (!($instance instanceof JUser) || is_string($id) || $instance->id !== $id)
but this condition alway true becouse
$instance->id !== $id is always true because $instance->id is string type and $id must be not string type
Category | ⇒ | Libraries |
That is the problem. If we pass id type string then condition is true and function will create new user instead of return the existing.
Labels |
Added:
?
|
Status | New | ⇒ | Needs Review |
Since is_string($id)
condition is true, the last condition will not be evaluated. This issue can be closed.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-12-09 06:55:44 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/10543
closed as stated above.
Thanks @Quy.
As far as I know, $id is also a string