Reviewed-by: Peter Müller peter.mueller@ipfire.org
Prevents "use of uninitialized value" warnings when the CGI is called with broken undefined GET parameters.
Signed-off-by: Leo-Andres Hofmann hofmann@leo-andres.de
html/cgi-bin/getrrdimage.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/html/cgi-bin/getrrdimage.cgi b/html/cgi-bin/getrrdimage.cgi index 26e026bba..6ec91cc92 100644 --- a/html/cgi-bin/getrrdimage.cgi +++ b/html/cgi-bin/getrrdimage.cgi @@ -44,9 +44,9 @@ my @supported_origins = ("entropy.cgi", "hardwaregraphs.cgi", "media.cgi", my $uri = URI->new($ENV{'REQUEST_URI'}); my %query = $uri->query_form;
-my $origin = lc $query{'origin'}; # lower case -my $graph = $query{'graph'}; -my $range = lc $query{'range'}; # lower case +my $origin = lc ($query{'origin'} // ''); # lower case +my $graph = $query{'graph'} // ''; +my $range = lc ($query{'range'} // ''); # lower case
# Check parameters unless(($origin =~ /^\w+?.cgi$/) && ($graph =~ /^[\w-.,; ]+?$/) && ($range ~~ @Graphs::time_ranges)) {