Compare commits

...

1 Commits

Author SHA1 Message Date
Sebastiaan Provost 5642614492 Backporting the changes made in #139 (#140)
* 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
2017-02-03 23:48:59 +01:00
@@ -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;