aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-09-25 15:38:51 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-25 15:38:51 -0400
commit093e8154408d9a7517a0df1768f44ad581c70be2 (patch)
treeb0ceb72d2738d49e9cecccb57f6dfd223ba09f17 /IkiWiki/Plugin
parent4c6d359b5fbe8f746965a2646a7bea03284b23cc (diff)
downloadikiwiki-093e8154408d9a7517a0df1768f44ad581c70be2.tar
ikiwiki-093e8154408d9a7517a0df1768f44ad581c70be2.tar.gz
aggregate: Avoid uninitialized value warnings for pages with no recorded ctime.
I saw this in the wild, apparently a page was not present on disk, but was in the aggregate db, and not marked as expired either. Not sure how that happened, but such pages should get marked as expired since they have an effectively zero ctime.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/aggregate.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 2b40625db..07c557bcd 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -420,11 +420,11 @@ sub expire () { #{{{
next unless $feed->{expireage} || $feed->{expirecount};
my $count=0;
my %seen;
- foreach my $item (sort { $IkiWiki::pagectime{$b->{page}} <=> $IkiWiki::pagectime{$a->{page}} }
+ foreach my $item (sort { ($IkiWiki::pagectime{$b->{page}} || 0) <=> ($IkiWiki::pagectime{$a->{page}} || 0) }
grep { exists $_->{page} && $_->{feed} eq $feed->{name} }
values %guids) {
if ($feed->{expireage}) {
- my $days_old = (time - $IkiWiki::pagectime{$item->{page}}) / 60 / 60 / 24;
+ my $days_old = (time - ($IkiWiki::pagectime{$item->{page}} || 0) / 60 / 60 / 24;
if ($days_old > $feed->{expireage}) {
debug(sprintf(gettext("expiring %s (%s days old)"),
$item->{page}, int($days_old)));