New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Condition in JFactory::getUser() never false #10543
Comments
As far as I know, $id is also a string
|
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. |
Since |
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. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10543. |
Steps to reproduce the issue
Request the user with active user id
f.e. JFactory::getUser(308), assuming logged in user's id is 308
Expected result
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)
Actual result
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
The text was updated successfully, but these errors were encountered: