Browse Source

fix: port as int value

master
Dnomd343 2 years ago
parent
commit
fd6c6c701d
  1. 1
      src/Basis.php
  2. 1
      src/Check.php

1
src/Basis.php

@ -31,7 +31,6 @@ function isHost(string $host): bool { // IPv4 / IPv6 / Domain
} }
function isPort(int $port): bool { function isPort(int $port): bool {
$port = intval($port);
return ($port < 65536 and $port > 0); return ($port < 65536 and $port > 0);
} }

1
src/Check.php

@ -67,6 +67,7 @@ function kmsCheckCli(string $host): void {
exit; exit;
} }
} }
$port = intval($port);
if (!isPort($port)) { if (!isPort($port)) {
echo "Invalid port\n"; echo "Invalid port\n";
exit; exit;

Loading…
Cancel
Save