From a436da27e996004560f13185aabad2bf0476e912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 4 Dec 2021 16:09:27 +0100 Subject: [PATCH] Avoid dependency on `ext-filter` --- src/SshSocksConnector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SshSocksConnector.php b/src/SshSocksConnector.php index 886c19c..6f98436 100644 --- a/src/SshSocksConnector.php +++ b/src/SshSocksConnector.php @@ -78,7 +78,7 @@ public function __construct($uri, LoopInterface $loop = null) \parse_str(parse_url($uri, \PHP_URL_QUERY), $args); if (isset($args['bind'])) { $parts = parse_url('tcp://' . $args['bind']); - if (!isset($parts['scheme'], $parts['host'], $parts['port']) || \filter_var(\trim($parts['host'], '[]'), \FILTER_VALIDATE_IP) === false) { + if (!isset($parts['scheme'], $parts['host'], $parts['port']) || @\inet_pton(\trim($parts['host'], '[]')) === false) { throw new \InvalidArgumentException('Invalid bind address given'); } $this->bind = $args['bind'];