From 3e1fbdf298f16806e8f909b2f534b5279d583d82 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 5 Feb 2023 13:52:42 +0100 Subject: [PATCH 1/2] Fix for getNetConfig() resolving local server --- includes/dhcp.php | 2 -- includes/functions.php | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/dhcp.php b/includes/dhcp.php index 35080fe9..9165e8ae 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -133,8 +133,6 @@ function validateDHCPInput() } if (!filter_var($_POST['DefaultGateway'], FILTER_VALIDATE_IP) && !empty($_POST['DefaultGateway'])) { $errors .= _('Invalid default gateway.').'
'.PHP_EOL; - var_dump($_POST['DefaultGateway']); - die(); } if (($_POST['dhcp-iface'] == "1")) { if (!filter_var($_POST['RangeStart'], FILTER_VALIDATE_IP) && !empty($_POST['RangeStart'])) { diff --git a/includes/functions.php b/includes/functions.php index 6cfbeddd..2971a329 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -448,8 +448,8 @@ function ParseConfig($arrConfig) */ function getNetConfig($interface) { - $URI = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'] .'/ajax/networking/get_netcfg.php?iface='.$interface; - $jsonData = file_get_contents($URI); + $URI = $_SERVER['REQUEST_SCHEME'].'://' .'localhost'. dirname($_SERVER['SCRIPT_NAME']) .'/ajax/networking/get_netcfg.php?iface='.$interface; + $jsonData = file_get_contents($URI, true); return $jsonData; } @@ -757,7 +757,8 @@ function qr_encode($str) return preg_replace('/(? Date: Sun, 5 Feb 2023 13:53:18 +0100 Subject: [PATCH 2/2] Fix relative form action path --- templates/wireguard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/wireguard.php b/templates/wireguard.php index ee28dfa1..330d0ba5 100755 --- a/templates/wireguard.php +++ b/templates/wireguard.php @@ -27,7 +27,7 @@
showMessages(); ?> -
+