Browse Source

require internal validation

main
ghost 1 year ago
parent
commit
26315c924f
  1. 23
      src/Socket.php

23
src/Socket.php

@ -30,14 +30,19 @@ class Socket @@ -30,14 +30,19 @@ class Socket
public static function isOpen(string $host, int $port = -1, ?float $timeout = null, int &$error_code = null, string &$error_message = null): bool
{
return is_resource(
@fsockopen(
$host,
$port,
$error_code,
$error_message,
$timeout
)
);
if (self::isHost($host) && self::isPort($port))
{
return is_resource(
@fsockopen(
$host,
$port,
$error_code,
$error_message,
$timeout
)
);
}
return false;
}
}
Loading…
Cancel
Save