]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
wireguard.cgi: Allow the endpoint to be empty
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 24 Apr 2024 22:34:34 +0000 (00:34 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Apr 2025 14:48:31 +0000 (16:48 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/wireguard.cgi

index 3d7e98dcf6f3a6302ced42ea316d25ef43921450..05ea3f130ba6ba2ae242b3a1b19498b14357d715 100644 (file)
@@ -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:
 
                                        <td>
                                                <input type="text" name="ENDPOINT_ADDRESS"
-                                                       value="$cgiparams{'ENDPOINT_ADDRESS'}" required />
+                                                       value="$cgiparams{'ENDPOINT_ADDRESS'}" />
                                        </td>
                                </tr>