summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindex.cgi4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.cgi b/index.cgi
index c79f761..786847b 100755
--- a/index.cgi
+++ b/index.cgi
@@ -295,10 +295,10 @@ sub get_archives {
my $query = 'SELECT title, date, uri FROM articles WHERE enabled=1 ORDER BY date DESC';
my $sth = $dbh->prepare($query);
$sth->execute || die $dbh->errstr;
+
while (my $result = $sth->fetchrow_hashref) {
$result->{'date'} =~ /(\d{4})\-(\d{2})\-\d{2} \d{2}\:\d{2}\:\d{2}/;
($result->{'year'}, $result->{'month'}) = ($1, $2);
- my $title = $result->{'title'};
if (($result->{'year'} eq $current_year) && ($result->{'month'} eq $current_month) && $result->{'uri'}) {
push(@{$history{$result->{'year'}}{$result->{'month'}}->{'uri_loop'}},
@@ -306,7 +306,7 @@ sub get_archives {
year => $result->{'year'},
month => $result->{'month'},
month_name => $months{$result->{'month'}},
- title => $title,
+ title => $result->{'title'},
uri => $result->{'uri'},
}
);