--- webui.orig/cgi-bin/dspam.cgi 2007-02-14 13:18:59.000000000 -0500 +++ webui/cgi-bin/dspam.cgi 2007-03-27 16:43:46.000000000 -0400 @@ -531,10 +532,13 @@ foreach my $period (qw( daily weekly )) { my $uc_period=uc($period); my $hk="DATA_$uc_period"; - my %lst=(); + my %lst=( + spam => [], + nonspam => [], + title => [] + ); foreach my $hr (sort {$a->{idx}<=>$b->{idx}} (values %{$Stats{$period}})) { foreach my $type (qw( spam nonspam title )) { - (exists $lst{$type}) || ($lst{$type}=[]); push(@{$lst{$type}},$hr->{$type}); my $totk=""; if ($type eq "spam") { $totk="S"; } @@ -546,9 +550,9 @@ } } $DATA{$hk}=join("_", - join(",",@{$lst{spam}}), - join(",",@{$lst{nonspam}}), - join(",",@{$lst{title}}), + join(",",@{$lst{spam}} || [0]), + join(",",@{$lst{nonspam}} || [0]), + join(",",@{$lst{title}} || [0]), ); } @@ -698,7 +702,7 @@ } open(FILE, "<$MAILBOX"); while() { - chomp; + s/\r?\n$//; push(@buffer, $_); } close(FILE); @@ -759,7 +763,7 @@ open(FILE, "<$MAILBOX"); while() { - chomp; + s/\r?\n$//; push(@buffer, $_); } close(FILE); @@ -839,7 +843,7 @@ open(FILE, "<$MAILBOX"); while() { - chomp; + s/\r?\n//; push(@buffer, $_); } close(FILE); @@ -907,7 +911,7 @@ } open(FILE, "<$MAILBOX"); while() { - chomp; + s/\r?\n//; push(@buffer, $_); } close(FILE); @@ -980,7 +984,7 @@ $rowclass="rowEven"; open(FILE, "<$MAILBOX"); while() { - chomp; + s/\r?\n//; if ($_ ne "") { if ($mode eq "") { if ($_ =~ /^From /) {