From cc203a41265c8ec5564be204293cf86ac9533e81 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 25 Apr 2024 00:34:34 +0200 Subject: [PATCH] wireguard.cgi: Allow the endpoint to be empty Signed-off-by: Michael Tremer --- html/cgi-bin/wireguard.cgi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/wireguard.cgi b/html/cgi-bin/wireguard.cgi index 3d7e98dcf..05ea3f130 100644 --- a/html/cgi-bin/wireguard.cgi +++ b/html/cgi-bin/wireguard.cgi @@ -172,7 +172,9 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{'save'}) { } # Check the endpoint address - unless (&Network::check_ip_address($cgiparams{'ENDPOINT_ADDRESS'})) { + if ($cgiparams{'ENDPOINT_ADDRESS'} eq '') { + # The endpoint address may be empty + } elsif (!&Network::check_ip_address($cgiparams{'ENDPOINT_ADDRESS'})) { push(@errormessages, $Lang::tr{'wg invalid endpoint address'}); } @@ -585,7 +587,7 @@ EDITOR: + value="$cgiparams{'ENDPOINT_ADDRESS'}" /> -- 2.39.5