functions.inc.php: checkdnsrr may not exist; try and be graceful

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@353 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 16 years ago
parent 40417e9247
commit 0d559f2d57

@ -282,15 +282,15 @@ function check_email ($email)
// Look for an AAAA, A, or MX record for the domain
// AAAA (IPv6) is only available in PHP v. >= 5
if (version_compare(phpversion(), "5.0.0", ">="))
{
if (checkdnsrr($domain,'AAAA')) return true;
if(function_exists('checkdnsrr')) {
// AAAA (IPv6) is only available in PHP v. >= 5
if (version_compare(phpversion(), "5.0.0", ">="))
{
if (checkdnsrr($domain,'AAAA')) return true;
}
if (checkdnsrr($domain,'A')) return true;
if (checkdnsrr($domain,'MX')) return true;
}
if (checkdnsrr($domain,'A')) return true;
if (checkdnsrr($domain,'MX')) return true;
# TODO: different error message for non-existing domains (instead of "email is invalid")
return false;
}

Loading…
Cancel
Save