Switch to is_string
native method
This commit is contained in:
parent
6071ff6c8f
commit
91b665c12a
@ -80,7 +80,7 @@ class UrlValidator extends ConstraintValidator
|
||||
if ($constraint->checkDNS) {
|
||||
$host = parse_url($value, PHP_URL_HOST);
|
||||
|
||||
if ('' === $host || !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 New Issue
Block a user