mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-10-27 07:33:32 +03:00
Can't reliably check IPv6 support
This commit is contained in:
parent
8f645388fc
commit
f455aea5ff
1 changed files with 6 additions and 1 deletions
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace SnappyMail;
|
||||
|
||||
// Sockets extension not loaded?
|
||||
if (!defined('AF_INET6')) {
|
||||
define('AF_INET6', true);
|
||||
}
|
||||
|
||||
abstract class DNS
|
||||
{
|
||||
/**
|
||||
|
|
@ -75,7 +80,7 @@ abstract class DNS
|
|||
public static function IP(string $domain): array
|
||||
{
|
||||
$ips = array();
|
||||
foreach (\dns_get_record($host, \DNS_A | (\defined('AF_INET6') ? \DNS_AAAA : 0)) ?: array() as $record) {
|
||||
foreach (\dns_get_record($host, \DNS_A | (\AF_INET6 ? \DNS_AAAA : 0)) ?: array() as $record) {
|
||||
if (!empty($record['ip'])) {
|
||||
$ips[] = $record['ip'];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue