mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-31 04:28:57 +00:00
* Backporting the changes made in https://github.com/egulias/EmailValidator/pull/139 so this functionality is also accessible in the 1.2.x releases. This fix allows for more compliance with the DNS RFC. Explanation here: https://github.com/egulias/EmailValidator/pull/139/commits/08bac068c26edd210daa259a2819d7dfd7438091
This commit is contained in:
committed by
Eduardo Gulias Davis
parent
b8bb147f46
commit
5642614492
@@ -184,7 +184,10 @@ class EmailValidator implements EmailValidatorInterface
|
||||
*/
|
||||
protected function checkDNS()
|
||||
{
|
||||
$mxRecordExists = checkdnsrr(trim($this->parser->getParsedDomainPart()), 'MX');
|
||||
$host = $this->parser->getParsedDomainPart();
|
||||
$host = rtrim($host, '.') . '.';
|
||||
|
||||
$mxRecordExists = checkdnsrr($host, 'MX');
|
||||
|
||||
if (!$mxRecordExists) {
|
||||
$this->warnings[] = self::DNSWARN_NO_RECORD;
|
||||
|
||||
Reference in New Issue
Block a user