|
@@ 59-64 (lines=6) @@
|
| 56 |
|
$value = (string) $value; |
| 57 |
|
|
| 58 |
|
$noRfcValidator = new NoRFCEmailValidator(); |
| 59 |
|
if (!$noRfcValidator->isValid($value)) { |
| 60 |
|
$this->context->buildViolation($constraint->message) |
| 61 |
|
->setParameter('{{ value }}', $this->formatValue($value)) |
| 62 |
|
->setCode(Email::INVALID_FORMAT_ERROR) |
| 63 |
|
->addViolation(); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
$host = (string) substr($value, strrpos($value, '@') + 1); |
| 67 |
|
|
|
@@ 69-78 (lines=10) @@
|
| 66 |
|
$host = (string) substr($value, strrpos($value, '@') + 1); |
| 67 |
|
|
| 68 |
|
// Check for host DNS resource records |
| 69 |
|
if ($constraint->checkMX) { |
| 70 |
|
if (!$this->checkMX($host)) { |
| 71 |
|
$this->context->buildViolation($constraint->message) |
| 72 |
|
->setParameter('{{ value }}', $this->formatValue($value)) |
| 73 |
|
->setCode(Email::MX_CHECK_FAILED_ERROR) |
| 74 |
|
->addViolation(); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
return; |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
if ($constraint->checkHost && !$this->checkHost($host)) { |
| 81 |
|
$this->context->buildViolation($constraint->message) |
|
@@ 80-85 (lines=6) @@
|
| 77 |
|
return; |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
if ($constraint->checkHost && !$this->checkHost($host)) { |
| 81 |
|
$this->context->buildViolation($constraint->message) |
| 82 |
|
->setParameter('{{ value }}', $this->formatValue($value)) |
| 83 |
|
->setCode(Email::HOST_CHECK_FAILED_ERROR) |
| 84 |
|
->addViolation(); |
| 85 |
|
} |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
/** |