From 12ab3df1a808e98ad44c27f14339424b89f7b931 Mon Sep 17 00:00:00 2001 From: Squidly271 Date: Tue, 16 Sep 2025 21:34:37 -0400 Subject: [PATCH] Fix: PHP error when changing container network if wireguard isn't enabled --- .../plugins/dynamix.docker.manager/include/CreateDocker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php diff --git a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php old mode 100644 new mode 100755 index 4f54ad238..794faadfb --- a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php +++ b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php @@ -1094,8 +1094,8 @@ _(Network Type)_: $n = $x ? 1 : 0; while (isset($$eth["VLANID:$n"]) && $$eth["VLANID:$n"] != $x) $n++; if (!empty($$eth["DESCRIPTION:$n"])) $name .= ' -- '.compress(trim($$eth["DESCRIPTION:$n"])); } elseif (preg_match('/^wg[0-9]+$/',$network)) { - $conf = file("/etc/wireguard/$network.conf"); - if ($conf[1][0]=='#') $name .= ' -- '.compress(trim(substr($conf[1],1))); + $conf = is_file("/etc/wireguard/$network.conf") ? file("/etc/wireguard/$network.conf") : []; + if ( ($conf[1][0]??'')=='#') $name .= ' -- '.compress(trim(substr($conf[1],1))); } elseif (substr($network,0,4)=='wlan') { $name .= ' -- '._('Wireless interface'); }