From 5be59c4e35b9108b7ce3adf8c64099706e622d11 Mon Sep 17 00:00:00 2001 From: Marc Hagen Date: Wed, 23 Nov 2022 11:50:57 +0100 Subject: [PATCH] Use consts --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index e776a8e..e3b699e 100644 --- a/index.php +++ b/index.php @@ -42,7 +42,7 @@ if (!empty($_POST)) { if (in_array($_POST['backendMethod'], ['ping', 'mtr', 'traceroute'])) { if (!LookingGlass::isValidIpv4($_POST['targetHost'])) { - $targetHost = LookingGlass::isValidHost($_POST['targetHost'], 'ipv4'); + $targetHost = LookingGlass::isValidHost($_POST['targetHost'], LookingGlass::IPV4); if (!$targetHost) { $errorMessage = 'No valid IPv4 provided.'; break; @@ -50,9 +50,10 @@ if (!empty($_POST)) { $_SESSION['TARGET'] = $targetHost; } } + if (in_array($_POST['backendMethod'], ['ping6', 'mtr6', 'traceroute6'])) { if (!LookingGlass::isValidIpv6($_POST['targetHost'])) { - $targetHost = LookingGlass::isValidHost($_POST['targetHost'], 'ipv6'); + $targetHost = LookingGlass::isValidHost($_POST['targetHost'], LookingGlass::IPV4); if (!$targetHost) { $errorMessage = 'No valid IPv6 provided.'; break; @@ -60,6 +61,7 @@ if (!empty($_POST)) { $_SESSION['TARGET'] = $targetHost; } } + $_SESSION['TERMS'] = true; $_SESSION['BACKEND'] = true; break;