From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4d9FC34TTbz32d0 for ; Mon, 17 Nov 2025 17:30:55 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4d9FC01vpGz32KS for ; Mon, 17 Nov 2025 17:30:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4d9FBz3TMvz101; Mon, 17 Nov 2025 17:30:51 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1763400651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xIRvp9wTqBUsBy8QKdSFT1b1Hhj3kz3BN3u8lmL5RZY=; b=SRPoVTPWR+20jLarXXe6tyojQ/m/hHr0psafZncqyuJddN4k6rzsio706MYTZK4l2LdT/q lPJryCVqGO8dGoDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1763400651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xIRvp9wTqBUsBy8QKdSFT1b1Hhj3kz3BN3u8lmL5RZY=; b=lcV74JzJ2aSzukBsJwEGZxhiQOlA0dgUJxZs2lYYNJLFmVSaFoAAszIO29KrvAxLVNyDZm FsqwH1564BfHPPbnyKrsl40xWTSYye0t1KOd5XUSAr4arJFCl9YivylXhLdd33zVFC0+DB z12LkM7vDvz2YhSxPPktEvu1Sx1YhTieoTQzAcE2aKTvrqV2hoDJDVzKSHAFJ8QirYckEr Rzwpzvj0rh13PCaTFKvrDKjMsP+WJRHLKMN7Hfbq5Py1WV+RTuMvtSTgP2U2EAewOcSAsE XoKwOK56MtYxz1d78kdSJp/050p7CbIBhdxyedKINAMQwrGfgARVun1cb9F/iQ== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH] fwhosts.cgi: Don't check Country Code when locationgrp initially created Date: Mon, 17 Nov 2025 18:30:47 +0100 Message-ID: <20251117173047.184929-2-adolf.belka@ipfire.org> In-Reply-To: <20251117173047.184929-1-adolf.belka@ipfire.org> References: <20251117173047.184929-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit - 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 --- 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