mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/9598] checkdnsrr() is now available on Windows with PHP 5.3 or later. Change if block order to always call checkdnsrr() if the function is available.
PHPBB3-9598
This commit is contained in:
parent
91399fd357
commit
99482e9555
1 changed files with 7 additions and 11 deletions
|
@ -3409,13 +3409,14 @@ function phpbb_checkdnsrr($host, $type = '')
|
||||||
{
|
{
|
||||||
$type = (!$type) ? 'MX' : $type;
|
$type = (!$type) ? 'MX' : $type;
|
||||||
|
|
||||||
if (DIRECTORY_SEPARATOR == '\\')
|
// Call checkdnsrr() if available. This is also the case on Windows with PHP 5.3 or later.
|
||||||
|
if (function_exists('checkdnsrr'))
|
||||||
{
|
{
|
||||||
if (!function_exists('exec'))
|
// The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
|
||||||
{
|
return checkdnsrr($host . '.', $type);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
else if (DIRECTORY_SEPARATOR == '\\' && function_exists('exec'))
|
||||||
|
{
|
||||||
// @exec('nslookup -retry=1 -timout=1 -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
|
// @exec('nslookup -retry=1 -timout=1 -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
|
||||||
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host) . '.', $output);
|
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host) . '.', $output);
|
||||||
|
|
||||||
|
@ -3441,11 +3442,6 @@ function phpbb_checkdnsrr($host, $type = '')
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (function_exists('checkdnsrr'))
|
|
||||||
{
|
|
||||||
// The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
|
|
||||||
return (checkdnsrr($host . '.', $type)) ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue