Updating deep email validation to check and use 'getmxrr' or 'checkdnsrr' if either function exists

This commit is contained in:
ADmad 2010-01-05 03:04:46 +05:30
parent 2ace6bb0b1
commit 9d5015882f

View file

@ -501,8 +501,13 @@ class Validation extends Object {
}
if ($return === true && preg_match('/@(' . $_this->__pattern['hostname'] . ')$/i', $_this->check, $regs)) {
$host = gethostbynamel($regs[1]);
return is_array($host);
if (function_exists('getmxrr')) {
return getmxrr($regs[1], $mxhosts);
}
if (function_exists('checkdnsrr')) {
return checkdnsrr($regs[1], 'MX');
}
return is_array(gethostbynamel($regs[1]));
}
return false;
}