File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
user_guide_src/source/libraries Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -690,14 +690,23 @@ Your new custom rule could now be used just like any other rule:
690
690
Allowing Parameters
691
691
-------------------
692
692
693
- If your method needs to work with parameters, the function will need a minimum of three parameters: the value to validate,
694
- the parameter string, and an array with all of the data that was submitted the form. The ``$data `` array is especially handy
693
+ If your method needs to work with parameters, the function will need a minimum of three parameters:
694
+
695
+ 1. the value to validate (``$value ``)
696
+ 2. the parameter string (``$params ``)
697
+ 3. an array with all of the data that was submitted the form (``$data ``)
698
+ 4. (optional) a custom error string (``&$error ``), just as described above.
699
+
700
+ .. warning :: The field values in ``$data`` are unvalidated (or may be invalid).
701
+ Using unvalidated input data is a source of vulnerability. You must
702
+ perform the necessary validation within your custom rules before using the
703
+ data in ``$data ``.
704
+
705
+ The ``$data `` array is especially handy
695
706
for rules like ``required_with `` that needs to check the value of another submitted field to base its result on:
696
707
697
708
.. literalinclude :: validation/037.php
698
709
699
- Custom errors can be returned as the fourth parameter ``&$error ``, just as described above.
700
-
701
710
.. _validation-using-closure-rule :
702
711
703
712
Using Closure Rule
You can’t perform that action at this time.
0 commit comments