? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
11 Oct 2020

Summary of Changes

Removal of redundant code.

Second condition is always true because is_object($data) is already true at this point.

Testing Instructions

Code review

avatar PhilETaylor PhilETaylor - open - 11 Oct 2020
avatar PhilETaylor PhilETaylor - change - 11 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Oct 2020
Category Front End Plugins
avatar PhilETaylor PhilETaylor - change - 11 Oct 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 11 Oct 2020
avatar PhilETaylor PhilETaylor - change - 11 Oct 2020
Title
Second condition is always 'true' because 'is_object($data)'
[4] Second condition is always 'true' because 'is_object($data)'
avatar PhilETaylor PhilETaylor - edited - 11 Oct 2020
avatar HLeithner
HLeithner - comment - 11 Oct 2020

Did you see the elseif 4 lines above?

avatar PhilETaylor
PhilETaylor - comment - 11 Oct 2020

I read the whole method.

The fact is, that it cannot pass the first test is_object and then fail is_null

The check for is_null is totally redundant and impossible to get to, because to get to the second condition (to test for null) it first has to succeed to be an object - and if its an object its NEVER going to be a null as the result of is_object(null) is false.

avatar HLeithner
HLeithner - comment - 11 Oct 2020

That's what I mean can you fix the other if statement too please?

avatar PhilETaylor
PhilETaylor - comment - 11 Oct 2020

yup

avatar PhilETaylor PhilETaylor - change - 11 Oct 2020
Labels Added: ?
avatar PhilETaylor
PhilETaylor - comment - 11 Oct 2020

Done.

avatar ceford ceford - test_item - 14 Oct 2020 - Tested successfully
avatar ceford
ceford - comment - 14 Oct 2020

I have tested this item successfully on 0bd6b20

Applied patch, saw the code change and understood it should work fine. But where is it called?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31049.

avatar flo-the-cat flo-the-cat - test_item - 17 Oct 2020 - Tested successfully
avatar flo-the-cat
flo-the-cat - comment - 17 Oct 2020

I have tested this item successfully on 0bd6b20

Code is applied and conditions cleaned up


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31049.

avatar HLeithner HLeithner - change - 17 Oct 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-17 10:34:10
Closed_By HLeithner
avatar HLeithner HLeithner - close - 17 Oct 2020
avatar HLeithner HLeithner - merge - 17 Oct 2020
avatar HLeithner
HLeithner - comment - 17 Oct 2020

@ceford the code is used for 2fa but only if the data provided is not a prepared object so it's possble that under normal conditions the code path is never executed.

Thanks Phil

Add a Comment

Login with GitHub to post a comment