From: Stefan Schantl Date: Sun, 17 Apr 2022 13:03:56 +0000 (+0200) Subject: ids.cgi: Proper handle providers which are not longer supported. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6bef05b9ed1eacb57f66f565def49bbfe6400946;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Proper handle providers which are not longer supported. They will be shown with a different background colour to get the users attention. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index cdfc77ac08..2a837bfc1e 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -1161,6 +1161,16 @@ END $col="bgcolor='$color{'color20'}'"; } + # Handle providers which are not longer supported. + unless ($provider_name) { + # Set the provider name to the provider handle + # to display something helpful. + $provider_name = $provider; + + # Assign background color + $col="bgcolor='#FF4D4D'"; + } + # Choose icons for the checkboxes. my $status_gif; my $status_gdesc; @@ -2031,6 +2041,9 @@ sub get_provider_name($) { my ($handle) = @_; my $provider_name; + # Early exit if the given provider does not longer exist. + return unless ($IDS::Ruleset::Providers{$handle}); + # Get the required translation string for the given provider handle. my $tr_string = $IDS::Ruleset::Providers{$handle}{'tr_string'};