From 123eed8963c38f0338e30ce069f1b109e3e230b3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 24 Sep 2024 08:38:34 +0200 Subject: [PATCH] openvpn: squelch a PHP warning --- src/etc/inc/plugins.inc.d/openvpn.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/etc/inc/plugins.inc.d/openvpn.inc b/src/etc/inc/plugins.inc.d/openvpn.inc index ddaf839a5..142ed8200 100644 --- a/src/etc/inc/plugins.inc.d/openvpn.inc +++ b/src/etc/inc/plugins.inc.d/openvpn.inc @@ -503,7 +503,7 @@ function openvpn_reconfigure($mode, $settings, $device_only = false) if (substr($settings['protocol'], 0, 3) == "TCP") { $proto = "{$proto}-{$mode}"; } - $cipher = $settings['crypto']; + $cipher = $settings['crypto'] ?? ''; /* defaults to SHA1, so use it when unset to maintain compatibility */ $digest = !empty($settings['digest']) ? $settings['digest'] : 'SHA1'; @@ -543,6 +543,7 @@ function openvpn_reconfigure($mode, $settings, $device_only = false) $conf .= "persist-tun\n"; $conf .= "persist-key\n"; $conf .= "proto {$proto}\n"; + /* can both be '' or 'none' depending on the age of the config */ if (!empty($cipher) && $cipher != 'none') { $conf .= "cipher {$cipher}\n"; }