Fixed EmailValidator`to prevent false-positives checks

Fixed EmailValidator`to prevent false-positives checks when property `checkDns` is set to `true`

Fixes #12714
This commit is contained in:
SilverFire - Dmitry Naumenko
2016-11-13 18:12:34 +02:00
parent 14b4f52e44
commit 332637db83
2 changed files with 2 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class EmailValidator extends Validator
} else {
$valid = preg_match($this->pattern, $value) || $this->allowName && preg_match($this->fullPattern, $value);
if ($valid && $this->checkDNS) {
$valid = checkdnsrr($matches['domain'], 'MX') || checkdnsrr($matches['domain'], 'A');
$valid = checkdnsrr($matches['domain'] . '.', 'MX') || checkdnsrr($matches['domain'] . '.', 'A');
}
}
}