mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
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:
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user