aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-05-13 13:28:55 +0200
committerNils Adermann <naderman@naderman.de>2010-05-14 02:39:04 +0200
commit99482e95557026e9562825cda8eebe61ed880c01 (patch)
treecb2298aa7f9d82ad433cfe4c93c9198677668155 /phpBB/includes/functions.php
parent91399fd3571fc2fe95eb680564cad6103adadf59 (diff)
downloadforums-99482e95557026e9562825cda8eebe61ed880c01.tar
forums-99482e95557026e9562825cda8eebe61ed880c01.tar.gz
forums-99482e95557026e9562825cda8eebe61ed880c01.tar.bz2
forums-99482e95557026e9562825cda8eebe61ed880c01.tar.xz
forums-99482e95557026e9562825cda8eebe61ed880c01.zip
[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
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4f52c7c2ce..c88e434b4b 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3409,13 +3409,14 @@ function phpbb_checkdnsrr($host, $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'))
+ {
+ // The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
+ return checkdnsrr($host . '.', $type);
+ }
+ else if (DIRECTORY_SEPARATOR == '\\' && function_exists('exec'))
{
- if (!function_exists('exec'))
- {
- return NULL;
- }
-
// @exec('nslookup -retry=1 -timout=1 -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;
}
- 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;
}