From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../php/vendor/react/dns/src/Config/HostsFile.php | 151 --------------------- 1 file changed, 151 deletions(-) delete mode 100755 assets/php/vendor/react/dns/src/Config/HostsFile.php (limited to 'assets/php/vendor/react/dns/src/Config/HostsFile.php') diff --git a/assets/php/vendor/react/dns/src/Config/HostsFile.php b/assets/php/vendor/react/dns/src/Config/HostsFile.php deleted file mode 100755 index 5b6277e..0000000 --- a/assets/php/vendor/react/dns/src/Config/HostsFile.php +++ /dev/null @@ -1,151 +0,0 @@ -contents = $contents; - } - - /** - * Returns all IPs for the given hostname - * - * @param string $name - * @return string[] - */ - public function getIpsForHost($name) - { - $name = strtolower($name); - - $ips = array(); - foreach (preg_split('/\r?\n/', $this->contents) as $line) { - $parts = preg_split('/\s+/', $line); - $ip = array_shift($parts); - if ($parts && array_search($name, $parts) !== false) { - // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) - if (strpos($ip, ':') !== false && ($pos = strpos($ip, '%')) !== false) { - $ip = substr($ip, 0, $pos); - } - - if (@inet_pton($ip) !== false) { - $ips[] = $ip; - } - } - } - - return $ips; - } - - /** - * Returns all hostnames for the given IPv4 or IPv6 address - * - * @param string $ip - * @return string[] - */ - public function getHostsForIp($ip) - { - // check binary representation of IP to avoid string case and short notation - $ip = @inet_pton($ip); - if ($ip === false) { - return array(); - } - - $names = array(); - foreach (preg_split('/\r?\n/', $this->contents) as $line) { - $parts = preg_split('/\s+/', $line, null, PREG_SPLIT_NO_EMPTY); - $addr = array_shift($parts); - - // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) - if (strpos($addr, ':') !== false && ($pos = strpos($addr, '%')) !== false) { - $addr = substr($addr, 0, $pos); - } - - if (@inet_pton($addr) === $ip) { - foreach ($parts as $part) { - $names[] = $part; - } - } - } - - return $names; - } -} -- cgit v1.2.3