diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-06-17 14:31:35 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-06-17 14:31:35 +0000 |
commit | 3e1e908de0904ee5cd5f7dfdd04987a2d09c4380 (patch) | |
tree | 45b5eace575062f2f2bedcac3f644e8c4e9453b2 /lib/MGA/Advisories.pm | |
parent | caeb473fd926ef097e78804ac56fbd9fa6260704 (diff) | |
download | mgaadvisories-3e1e908de0904ee5cd5f7dfdd04987a2d09c4380.tar mgaadvisories-3e1e908de0904ee5cd5f7dfdd04987a2d09c4380.tar.gz mgaadvisories-3e1e908de0904ee5cd5f7dfdd04987a2d09c4380.tar.bz2 mgaadvisories-3e1e908de0904ee5cd5f7dfdd04987a2d09c4380.tar.xz mgaadvisories-3e1e908de0904ee5cd5f7dfdd04987a2d09c4380.zip |
Fix sorting of unpublished advisories
Diffstat (limited to 'lib/MGA/Advisories.pm')
-rw-r--r-- | lib/MGA/Advisories.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm index a4bd668..5130655 100644 --- a/lib/MGA/Advisories.pm +++ b/lib/MGA/Advisories.pm @@ -143,8 +143,9 @@ sub publish_advisories { sub adv_sort { my $advdb = shift; sort { - my $pa = $advdb->{advisories}{$a}{status}{published}; - my $pb = $advdb->{advisories}{$b}{status}{published}; + my $now = time; + my $pa = $advdb->{advisories}{$a}{status}{published} || $now; + my $pb = $advdb->{advisories}{$b}{status}{published} || $now; return $pa == $pb ? $b cmp $a : $pb cmp $pa; } @_; } |