From 019e5e9bafd6803792f4beaa68977bd68d015665 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sat, 20 Mar 2021 18:07:57 +0100 Subject: [PATCH] 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 --- html/cgi-bin/ids.cgi | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 478b2ff15..6ff29bd2c 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 <