diff --git a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php index 6989cd0ae..69b0d9203 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php +++ b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php @@ -322,10 +322,12 @@ $bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c'; # Search for existing TAILSCALE_ entries in the Docker template $TS_existing_vars = false; -foreach ($xml["Config"] as $config) { - if (isset($config["Target"]) && strpos($config["Target"], "TAILSCALE_") === 0) { - $TS_existing_vars = true; - break; +if (isset($xml["Config"]) && is_array($xml["Config"])) { + foreach ($xml["Config"] as $config) { + if (isset($config["Target"]) && strpos($config["Target"], "TAILSCALE_") === 0) { + $TS_existing_vars = true; + break; + } } } @@ -374,7 +376,7 @@ $TS_DirectMachineLink = $TS_MachinesLink; $TS_HostNameActual = ""; $TS_not_approved = ""; // Get Tailscale information and create arrays/variables -exec("docker exec -i ".$xml['Name']." /bin/sh -c \"tailscale status --peers=false --json\"", $TS_raw); +!empty($xml) && exec("docker exec -i " . escapeshellarg($xml['Name']) . " /bin/sh -c \"tailscale status --peers=false --json\"", $TS_raw); $TS_no_peers = json_decode(implode('', $TS_raw),true); $TS_container = json_decode(implode('', $TS_raw),true); $TS_container = $TS_container['Self']??''; @@ -871,10 +873,12 @@ $(function() { @@ -1100,8 +1104,9 @@ _(Fixed IP address)_ (_(optional)_): _(Container Network)_: :