Inital commit for unit test configuration
This commit is contained in:
committed by
Manish Verma
parent
2f0796e954
commit
e0436b7757
@@ -18,6 +18,13 @@ class DNSCheckValidation implements EmailValidation
|
||||
* @var InvalidEmail
|
||||
*/
|
||||
private $error;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('intl')) {
|
||||
throw new \LogicException(sprintf('The %s class requires the Intl extension.', __CLASS__));
|
||||
}
|
||||
}
|
||||
|
||||
public function isValid($email, EmailLexer $emailLexer)
|
||||
{
|
||||
@@ -44,7 +51,11 @@ class DNSCheckValidation implements EmailValidation
|
||||
|
||||
protected function checkDNS($host)
|
||||
{
|
||||
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46), '.') . '.';
|
||||
$variant = INTL_IDNA_VARIANT_2003;
|
||||
if ( defined('INTL_IDNA_VARIANT_UTS46') ) {
|
||||
$variant = INTL_IDNA_VARIANT_UTS46;
|
||||
}
|
||||
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.';
|
||||
|
||||
$Aresult = true;
|
||||
$MXresult = checkdnsrr($host, 'MX');
|
||||
|
||||
Reference in New Issue
Block a user