From 4175303cf8335efa8af6a1f902b506e331937a0f Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 14 May 2024 07:21:55 +0200 Subject: [PATCH] Fix: correctly parse multiple wg DNS entries, resolves #1585 --- includes/wireguard.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/wireguard.php b/includes/wireguard.php index 8aad76b5..3c9cee03 100755 --- a/includes/wireguard.php +++ b/includes/wireguard.php @@ -43,6 +43,9 @@ function DisplayWireGuardConfig() $wg_srvport = ($conf['ListenPort'] == '') ? getDefaultNetValue('wireguard','server','ListenPort') : $conf['ListenPort']; $wg_srvipaddress = ($conf['Address'] == '') ? getDefaultNetValue('wireguard','server','Address') : $conf['Address']; $wg_srvdns = ($conf['DNS'] == '') ? getDefaultNetValue('wireguard','server','DNS') : $conf['DNS']; + if (is_array($wg_srvdns)) { + $wg_srvdns = implode(', ', $wg_srvdns); + } $wg_peerpubkey = exec('sudo cat '. RASPI_WIREGUARD_PATH .'wg-peer-public.key', $return); if (sizeof($conf) >0) { $wg_senabled = true;