diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 8ebec266c0bf..eb2c497426b2 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -309,8 +309,6 @@ To give a labeled error message you can set up as: .. literalinclude:: validation/007.php :lines: 2- -.. _validation-withrequest: - .. note:: ``setRules()`` will overwrite any rules that were set previously. To add more than one rule to an existing set of rules, use ``setRule()`` multiple times. @@ -340,6 +338,8 @@ For example, data returned by multi select dropdown: .. literalinclude:: validation/011.php :lines: 2- +.. _validation-withrequest: + withRequest() ============= diff --git a/user_guide_src/source/libraries/validation/008.php b/user_guide_src/source/libraries/validation/008.php index 38656dda37cb..41e37f0652ef 100644 --- a/user_guide_src/source/libraries/validation/008.php +++ b/user_guide_src/source/libraries/validation/008.php @@ -4,7 +4,8 @@ $request = \Config\Services::request(); if ($validation->withRequest($request)->run()) { - // If you want to get the validated data. + // If you use the input data, you should get it from the getValidated() method. + // Otherwise you may create a vulnerability. $validData = $validation->getValidated(); // ...