@@ -233,7 +233,8 @@ checkDNS
233
233
234
234
By default, this constraint just validates the syntax of the given URL. If you
235
235
also need to check whether the associated host exists, set the ``checkDNS ``
236
- option to ``true ``:
236
+ option to the value of any of the ``CHECK_DNS_TYPE_* `` constants in the
237
+ :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Url ` class:
237
238
238
239
.. configuration-block ::
239
240
@@ -248,7 +249,7 @@ option to ``true``:
248
249
{
249
250
/**
250
251
* @Assert\Url(
251
- * checkDNS = true
252
+ * checkDNS = "ANY"
252
253
* )
253
254
*/
254
255
protected $bioUrl;
@@ -260,7 +261,7 @@ option to ``true``:
260
261
AppBundle\Entity\Author :
261
262
properties :
262
263
bioUrl :
263
- - Url : { checkDNS: true }
264
+ - Url : { checkDNS: 'ANY' }
264
265
265
266
.. code-block :: xml
266
267
@@ -273,7 +274,7 @@ option to ``true``:
273
274
<class name =" AppBundle\Entity\Author" >
274
275
<property name =" bioUrl" >
275
276
<constraint name =" Url" >
276
- <option name =" checkDNS" >true </option >
277
+ <option name =" checkDNS" >ANY </option >
277
278
</constraint >
278
279
</property >
279
280
</class >
@@ -292,13 +293,13 @@ option to ``true``:
292
293
public static function loadValidatorMetadata(ClassMetadata $metadata)
293
294
{
294
295
$metadata->addPropertyConstraint('bioUrl', new Assert\Url(array(
295
- 'checkDNS' => true ,
296
+ 'checkDNS' => Assert\Url::CHECK_DNS_TYPE_ANY ,
296
297
)));
297
298
}
298
299
}
299
300
300
301
This option uses the :phpfunction: `checkdnsrr ` PHP function to check the validity
301
- of the `` ANY `` DNS record corresponding to the host associated with the given URL.
302
+ of the DNS record corresponding to the host associated with the given URL.
302
303
303
304
dnsMessage
304
305
~~~~~~~~~~
0 commit comments