]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Allow '0' as a value in extra sections 198/head
authorStefan Mayr <stefan@mayr-stefan.de>
Thu, 7 Jan 2021 11:50:35 +0000 (12:50 +0100)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 11:50:35 +0000 (12:50 +0100)
Should fix an old bug/feature request to allow "0" as a value in extra sections, see https://sourceforge.net/p/awstats/bugs/756/

wwwroot/cgi-bin/awstats.pl

index e709b7f5c0b65674ac6eadc6528824c7320b3d1a..0bb4b26e2b60bd5bb9781ec087b7844e9f9cfe9f 100755 (executable)
@@ -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