From 8b94c03ca362625259d2fba287064e762db8090d Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:04:05 +0000 Subject: [PATCH] Non standard Webgui ports virt viewer fix. --- emhttp/plugins/dynamix.vm.manager/include/VMajax.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emhttp/plugins/dynamix.vm.manager/include/VMajax.php b/emhttp/plugins/dynamix.vm.manager/include/VMajax.php index 26032267f..934cd9e20 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/VMajax.php +++ b/emhttp/plugins/dynamix.vm.manager/include/VMajax.php @@ -150,7 +150,9 @@ function embed(&$bootcfg, $env, $key, $value) { $vvarray = array() ; $vvarray[] = "[virt-viewer]\n"; $vvarray[] = "type=$protocol\n"; - $vvarray[] = "host="._var($_SERVER,'HTTP_HOST')."\n" ; + $vvarrayhost = _var($_SERVER,'HTTP_HOST'); + if (strpos($vvarrayhost,":")) $vvarrayhost = parse_url($vvarrayhost,PHP_URL_HOST); + $vvarray[] = "host=$vvarrayhost\n" ; $vvarray[] = "port=$port\n" ; $vvarray[] = "delete-this-file=1\n" ; if (!is_dir("/mnt/user/system/remoteviewer")) mkdir("/mnt/user/system/remoteviewer") ; @@ -183,7 +185,9 @@ function embed(&$bootcfg, $env, $key, $value) { $vvarray = array() ; $vvarray[] = "[virt-viewer]\n"; $vvarray[] = "type=$protocol\n"; - $vvarray[] = "host="._var($_SERVER,'HTTP_HOST')."\n" ; + $vvarrayhost = _var($_SERVER,'HTTP_HOST'); + if (strpos($vvarrayhost,":")) $vvarrayhost = parse_url($vvarrayhost,PHP_URL_HOST); + $vvarray[] = "host=$vvarrayhost\n" ; $vvarray[] = "port=$port\n" ; $vvarray[] = "delete-this-file=1\n" ; if (!is_dir("/mnt/user/system/remoteviewer")) mkdir("/mnt/user/system/remoteviewer") ;