Skip to content

Commit 1ae4363

Browse files
committed
docs: add explanation and fix incorrect Parameter values
1 parent af55149 commit 1ae4363

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -833,20 +833,25 @@ valid_email No Fails if field does not contain a valid
833833
email address.
834834
valid_emails No Fails if any value provided in a comma
835835
separated list is not a valid email.
836-
valid_ip No Fails if the supplied IP is not valid. ``valid_ip[ipv6]``
836+
valid_ip Yes Fails if the supplied IP is not valid. ``valid_ip[ipv6]``
837837
Accepts an optional parameter of ``ipv4`` or
838838
``ipv6`` to specify an IP format.
839839
valid_url No Fails if field does not contain (loosely) a
840840
URL. Includes simple strings that could be
841841
hostnames, like "codeigniter".
842+
**Normally,** ``valid_url_strict`` **should
843+
be used.**
842844
valid_url_strict Yes Fails if field does not contain a valid URL. ``valid_url_strict[https]``
843845
You can optionally specify a list of valid
844846
schemas. If not specified, ``http,https``
845-
are valid. This rule uses
846-
PHP's ``FILTER_VALIDATE_URL``.
847-
valid_date No Fails if field does not contain a valid date. ``valid_date[d/m/Y]``
848-
Accepts an optional parameter to matches
849-
a date format.
847+
are valid. This rule uses PHP's
848+
``FILTER_VALIDATE_URL``.
849+
valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y]``
850+
Any string that `strtotime()`_ accepts is
851+
valid if you don't specify an optional
852+
parameter to matches a date format.
853+
**So it is usually necessary to specify
854+
the parameter.**
850855
valid_cc_number Yes Verifies that the credit card number matches ``valid_cc_number[amex]``
851856
the format used by the specified provider.
852857
Current supported providers are:
@@ -874,6 +879,7 @@ valid_cc_number Yes Verifies that the credit card number matches
874879
The Validation library **never alters the data** to validate.
875880

876881
.. _timezone_identifiers_list(): https://www.php.net/manual/en/function.timezone-identifiers-list.php
882+
.. _strtotime(): https://www.php.net/manual/en/function.strtotime.php
877883

878884
.. _rules-for-file-uploads:
879885

0 commit comments

Comments
 (0)