Core and composer updates
This commit is contained in:
parent
a82634bb98
commit
62cac30480
1118 changed files with 21770 additions and 6306 deletions
|
@ -93,7 +93,7 @@ class EmailValidator extends ConstraintValidator
|
|||
return;
|
||||
}
|
||||
|
||||
$host = substr($value, strrpos($value, '@') + 1);
|
||||
$host = (string) substr($value, strrpos($value, '@') + 1);
|
||||
|
||||
// Check for host DNS resource records
|
||||
if ($constraint->checkMX) {
|
||||
|
@ -138,7 +138,7 @@ class EmailValidator extends ConstraintValidator
|
|||
*/
|
||||
private function checkMX($host)
|
||||
{
|
||||
return checkdnsrr($host, 'MX');
|
||||
return '' !== $host && checkdnsrr($host, 'MX');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,6 +150,6 @@ class EmailValidator extends ConstraintValidator
|
|||
*/
|
||||
private function checkHost($host)
|
||||
{
|
||||
return $this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'));
|
||||
return '' !== $host && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ class UrlValidator extends ConstraintValidator
|
|||
if ($constraint->checkDNS) {
|
||||
$host = parse_url($value, PHP_URL_HOST);
|
||||
|
||||
if (!checkdnsrr($host, 'ANY')) {
|
||||
if (!is_string($host) || !checkdnsrr($host, 'ANY')) {
|
||||
if ($this->context instanceof ExecutionContextInterface) {
|
||||
$this->context->buildViolation($constraint->dnsMessage)
|
||||
->setParameter('{{ value }}', $this->formatValue($host))
|
||||
|
|
Reference in a new issue