- 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 <[email protected]>
Signed-off-by: Adolf Belka <[email protected]>
---
 html/cgi-bin/fwhosts.cgi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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.
-- 
2.51.2


Reply via email to