User tests: Successful: Unsuccessful:
Pull Request for Issue #16997
Currently there is a string with int comparison in the code (please see the code that i am chaning)
$root_user == $user_id
Example:
"somename" == 0
will return true,
because "somename" typecasted to integer is 0 , thus you get
0 == 0
which is true
There are several ways to fix the comparison, for consistenct, i choose to use same code as used in
JUser::authorize()
method
$root_user = "somename";
to configuration.phpThe module is not showed
The module is showed because all access levels have been granted to the guest user
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I have tested this item
Since we don't need to check any further if $root_user
is empty or the current user is a guest, how about this:
if (!empty($root_user) && (bool) $user->guest === false &&
($root_user === $user->username || (is_numeric($root_user) && (int) $root_user === $user->id)))
Status | Pending | ⇒ | Information Required |
Status | Information Required | ⇒ | Pending |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Labels |
Added:
Conflicting Files
?
|
Resolved conflicts
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-26 22:18:26 |
Closed_By | ⇒ | zero-24 | |
Labels |
Removed:
Conflicting Files
|
@Artwebco @pabloarias please test if this PR solve #16997