From: Stefan Schantl Date: Sat, 20 Mar 2021 17:07:57 +0000 (+0100) Subject: ids.cgi: Introduce and use get_provider_name() function. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=019e5e9bafd6803792f4beaa68977bd68d015665;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Introduce and use get_provider_name() function. This function is used to grab the name of a provider by the given handle. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 478b2ff154..6ff29bd2c7 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -900,20 +900,10 @@ END # Loop throgh the list of providers. foreach my $provider (@ruleset_providers) { - my $option_string; - - # Get the translation required string for the current provider. - my $tr_string = $IDS::Ruleset::Providers{$provider}{'tr_string'}; - - # Check if a translation string is available in the language files. - if ($Lang::tr{$tr_string}) { - # Use the translated string from the language file. - $option_string = $Lang::tr{$tr_string}; - } else { - # Fallback and use the provider summary from the providers file. - $option_string = $IDS::Ruleset::Providers{$provider}{'summary'}; - } + # Call get_provider_name function to obtain the provider name. + my $option_string = &get_provider_name($provider); + # Print option. print "\n"; } print <