Replace spaces in VM names

This commit is contained in:
SimonFair
2024-06-01 15:41:23 +01:00
parent e61132fe69
commit 91bc84a97a

View File

@@ -177,7 +177,8 @@ case 'domain-openWebUI':
}
if (strpos($WebUI,"[IP]") && $myIP == NULL) $arrResponse['error'] = "No IP, guest agent not installed?";
$WebUI = preg_replace("%\[IP\]%", $myIP, $WebUI);
$WebUI = preg_replace("%\[VMNAME\]%", $domName, $WebUI);
$vmnamehypen = str_replace(" ","-",$domName);
$WebUI = preg_replace("%\[VMNAME\]%", $vmnamehypen, $WebUI);
if (preg_match("%\[PORT:(\d+)\]%", $WebUI, $matches)) {
$ConfigPort = $matches[1] ?? '';
$WebUI = preg_replace("%\[PORT:\d+\]%", $ConfigPort, $WebUI);