-
Notifications
You must be signed in to change notification settings - Fork 23
Fix/latest versions security #88
base: master
Are you sure you want to change the base?
Conversation
@jvanderkroon could you please review this new patch to make sure it matches your initial intention? |
also related to #63 and TYPO3-Caretaker/caretaker_instance#56 |
NOT NOT MERGE (yet) Jigal suggested some changes/additions via mail and i'm going to add some more tests to cover thoses cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives the unsupported version 8.6.1 as security version for 8 LTS. I would expect at least the minimum regular release to be the security version
Jigals comment about the versioning
|
i'm going to extend the tests to cover these cases. |
$stable = array(); | ||
$security = array(); | ||
foreach ($releases as $major => $details) { | ||
if (is_array($details) && !empty($details['latest'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!empty($details['latest'])) is sufficient here
$max[$major] = $details['latest']; | ||
} | ||
|
||
if (is_array($details) && !empty($details['stable'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!empty($details['stable'])) is sufficient here
if (is_array($details) && !empty($details['stable'])) { | ||
$stable[$major] = $details['stable']; | ||
} | ||
if (is_array($details) && is_array($details['releases'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!empty($details['releases'])) is sufficient here
I did refactor Jorgen/Jigals patch from #76 and added a basic unit test.
As I didnt get the intention of the "$major > $latestLts" comparsion, I just removed that part.
Also, if a major version just has regular releases, but no security releases yet, the "latest security" version would fallback to the PATCH version ".0".