From: Stefan Mayr Date: Thu, 7 Jan 2021 11:50:35 +0000 (+0100) Subject: Allow '0' as a value in extra sections X-Git-Tag: AWSTATS_7_9~9^2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e927568a73460fc7c449d74226e39c3ade3c107c;p=thirdparty%2FAWStats.git Allow '0' as a value in extra sections Should fix an old bug/feature request to allow "0" as a value in extra sections, see https://sourceforge.net/p/awstats/bugs/756/ --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index e709b7f5..0bb4b26e 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -8490,7 +8490,6 @@ sub BuildKeyList { 3 ); } - delete $hashforselect->{0}; delete $hashforselect->{ '' }; # Those is to protect from infinite loop when hash array has an incorrect null key my $count = 0; @@ -20713,7 +20712,7 @@ s/^(cache|related):[^\+]+// } } if ( !$rowkeyok ) { next; } # End for this section - if ( !$rowkeyval ) { $rowkeyval = 'Failed to extract key'; } + if ( !defined($rowkeyval) ) { $rowkeyval = 'Failed to extract key'; } if ($Debug) { debug( " Key val found: $rowkeyval", 5 ); } # Apply function on $rowkeyval