mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-30 12:07:59 +00:00
INTL_IDNA_VARIANT_UTS46 is not supported on all systems (#173)
* INTL_IDNA_VARIANT_UTS46 is not supported on all systems Fall back to INTL_IDNA_VARIANT_2003 if INTL_IDNA_VARIANT_UTS46 is not found. * Fix syntax error * Update DNSCheckValidation.php
This commit is contained in:
committed by
Eduardo Gulias Davis
parent
135444003f
commit
54859fabea
@@ -51,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