aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MGA/Advisories.pm
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-17 14:31:35 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-17 14:31:35 +0000
commit3e1e908de0904ee5cd5f7dfdd04987a2d09c4380 (patch)
tree45b5eace575062f2f2bedcac3f644e8c4e9453b2 /lib/MGA/Advisories.pm
parentcaeb473fd926ef097e78804ac56fbd9fa6260704 (diff)
downloadmgaadvisories-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.pm5
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;
} @_;
}