From fd6c6c701d2756480328380b2ad5c94b72b66bd1 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 22 Oct 2022 16:21:20 +0800 Subject: [PATCH] fix: port as int value --- src/Basis.php | 1 - src/Check.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Basis.php b/src/Basis.php index d590724..287f2f2 100644 --- a/src/Basis.php +++ b/src/Basis.php @@ -31,7 +31,6 @@ function isHost(string $host): bool { // IPv4 / IPv6 / Domain } function isPort(int $port): bool { - $port = intval($port); return ($port < 65536 and $port > 0); } diff --git a/src/Check.php b/src/Check.php index 6a81ec0..a7d46d7 100644 --- a/src/Check.php +++ b/src/Check.php @@ -67,6 +67,7 @@ function kmsCheckCli(string $host): void { exit; } } + $port = intval($port); if (!isPort($port)) { echo "Invalid port\n"; exit;