From: Stefan Schantl Date: Sat, 7 Nov 2020 18:47:22 +0000 (+0100) Subject: location-functions.pl: Add get_continent_code() function. X-Git-Tag: v2.25-core155~384^2~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bf91fe1b1fb04e9dd422bdc1638e2592fd073b8;p=ipfire-2.x.git location-functions.pl: Add get_continent_code() function. This tiny function is used to get the continent code for a given country code. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 4837030161..e8db4ba9b7 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -190,6 +190,16 @@ sub get_locations() { return @sorted_locations; } +# Function to get the continent code of a given country code. +sub get_continent_code($) { + my ($country_code) = @_; + + # Use location module to grab the continent code. + my $continent_code = &Location::get_continent_code($db_handle, $country_code); + + return $continent_code; +} + # Function to check if a given address has one ore more special flags. sub address_has_flags($) { my ($address) = @_;