diff --git a/reference/constraints/Url.rst b/reference/constraints/Url.rst index 2de6b989358..6f507a9b062 100644 --- a/reference/constraints/Url.rst +++ b/reference/constraints/Url.rst @@ -233,7 +233,8 @@ checkDNS By default, this constraint just validates the syntax of the given URL. If you also need to check whether the associated host exists, set the ``checkDNS`` -option to ``true``: +option to the value of any of the ``CHECK_DNS_TYPE_*`` constants in the +:class:`Symfony\\Component\\Validator\\Constraints\\Url` class: .. configuration-block:: @@ -248,7 +249,7 @@ option to ``true``: { /** * @Assert\Url( - * checkDNS = true + * checkDNS = "ANY" * ) */ protected $bioUrl; @@ -260,7 +261,7 @@ option to ``true``: AppBundle\Entity\Author: properties: bioUrl: - - Url: { checkDNS: true } + - Url: { checkDNS: 'ANY' } .. code-block:: xml @@ -273,7 +274,7 @@ option to ``true``: - + @@ -292,13 +293,13 @@ option to ``true``: public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addPropertyConstraint('bioUrl', new Assert\Url(array( - 'checkDNS' => true, + 'checkDNS' => Assert\Url::CHECK_DNS_TYPE_ANY, ))); } } This option uses the :phpfunction:`checkdnsrr` PHP function to check the validity -of the ``ANY`` DNS record corresponding to the host associated with the given URL. +of the DNS record corresponding to the host associated with the given URL. dnsMessage ~~~~~~~~~~