File tree Expand file tree Collapse file tree
user_guide_src/source/libraries Expand file tree Collapse file tree 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:
690690Allowing Parameters
691691-------------------
692692
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
695706for rules like ``required_with `` that needs to check the value of another submitted field to base its result on:
696707
697708.. literalinclude :: validation/037.php
698709
699- Custom errors can be returned as the fourth parameter ``&$error ``, just as described above.
700-
701710.. _validation-using-closure-rule :
702711
703712Using Closure Rule
You can’t perform that action at this time.
0 commit comments