From: Adolf Belka Date: Mon, 17 Nov 2025 17:30:47 +0000 (+0100) Subject: fwhosts.cgi: Don't check Country Code when locationgrp initially created X-Git-Tag: v2.29-core199~17^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79da30641d5e3ab9ec33f78e842da851b469def6;p=ipfire-2.x.git fwhosts.cgi: Don't check Country Code when locationgrp initially created - When a location group is initially created the Country Code variable is blank. This causes an error message that the Country Code is invalid before any country code has been selected. This was flagged up by a new forum member. - This change only checks the Country Code variable for being valid if it is not blank - If this is not the best way to fix this problem, feel free to modify or replace it. - Tested as working on my vm testbed. Tested-by: Adolf Belka Signed-off-by: Adolf Belka Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 7820523c5..684b18794 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -703,8 +703,10 @@ if ($fwhostsettings{'ACTION'} eq 'savelocationgrp') # Check name if (!&validhostname($grp)){$errormessage.=$Lang::tr{'fwhost err name'};} - unless (&General::validcc($fwhostsettings{'COUNTRY_CODE'})) { - $errormessage = $Lang::tr{'fwhost invalid country code'}; + if ($fwhostsettings{'COUNTRY_CODE'} ne ''){ + unless (&General::validcc($fwhostsettings{'COUNTRY_CODE'})) { + $errormessage = $Lang::tr{'fwhost invalid country code'}; + } } # Check for existing group name.