Skip to content

Commit

Permalink
Make sure last minor version is not marked as security unless it actu…
Browse files Browse the repository at this point in the history
…ally is
  • Loading branch information
eiriksm committed Sep 8, 2021
1 parent df560cd commit 75b10aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,15 @@ protected function attachDrupalAdvisories(array &$alerts)
if (empty($xml->releases->release)) {
return;
}
$drupal_version_array = explode('.', $drupal->version);
$active_branch = sprintf('%s.%s', $drupal_version_array[0], $drupal_version_array[1]);
$supported_branches = explode(',', (string) $xml->supported_branches);
$is_supported = false;
foreach ($supported_branches as $branch) {
if (strpos($branch, $active_branch) === 0) {
$is_supported = true;
}
}
foreach ($xml->releases->release as $release) {
if (empty($release->version)) {
continue;
Expand All @@ -1570,6 +1579,12 @@ protected function attachDrupalAdvisories(array &$alerts)
continue;
}
$version = (string) $release->version;
// If they are not on the same branch, then let's skip it as well.
if ($endpoint !== '7.x') {
if ($is_supported && strpos($version, $active_branch) !== 0) {
continue;
}
}
if (version_compare($version, $drupal->version) !== 1) {
continue;
}
Expand Down

0 comments on commit 75b10aa

Please sign in to comment.