Skip to content

Commit 445ecce

Browse files
committed
Don't show recently EOLed branches in the supported versions table.
Changed the behaviour of get_active_branches() so that callers can choose whether to get recently EOLed branches or not. (This is basically for the supported versions page; the other callers -- namely the front page download links and bug tracker backend -- likely still want the previous behaviour.) After all, it's a little weird listing 5.5 as a supported version in the table when we just made a big deal of EOLing it!
1 parent 935c5b8 commit 445ecce

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

include/branches.inc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,18 @@ function get_all_branches() {
122122
return $branches;
123123
}
124124

125-
function get_active_branches() {
125+
function get_active_branches($include_recent_eols = true) {
126126
$branches = array();
127127
$now = new DateTime;
128128

129129
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
130130
foreach ($releases as $version => $release) {
131131
if ($branch = version_number_to_branch($version)) {
132-
if ($now < get_branch_security_eol_date($branch)->add($GLOBALS['KEEP_EOL'])) {
132+
$threshold = get_branch_security_eol_date($branch);
133+
if ($include_recent_eols) {
134+
$threshold->add($GLOBALS['KEEP_EOL']);
135+
}
136+
if ($now < $threshold) {
133137
$branches[$major][$branch] = $release;
134138
$branches[$major][$branch]['version'] = $version;
135139
}

supported-versions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</tr>
4848
</thead>
4949
<tbody>
50-
<?php foreach (get_active_branches() as $major => $releases): ?>
50+
<?php foreach (get_active_branches(false) as $major => $releases): ?>
5151
<?php ksort($releases) ?>
5252
<?php foreach ($releases as $branch => $release): ?>
5353
<?php

0 commit comments

Comments
 (0)