Skip to content

Commit ff931e2

Browse files
authored
Merge pull request #8154 from kenjis/docs-fix-validation.rst
docs: fix validation.rst
2 parents ab1c0c0 + 75907cf commit ff931e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

user_guide_src/source/libraries/validation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ To give a labeled error message you can set up as:
309309
.. literalinclude:: validation/007.php
310310
:lines: 2-
311311

312-
.. _validation-withrequest:
313-
314312
.. note:: ``setRules()`` will overwrite any rules that were set previously. To add more than one
315313
rule to an existing set of rules, use ``setRule()`` multiple times.
316314

@@ -340,6 +338,8 @@ For example, data returned by multi select dropdown:
340338
.. literalinclude:: validation/011.php
341339
:lines: 2-
342340

341+
.. _validation-withrequest:
342+
343343
withRequest()
344344
=============
345345

user_guide_src/source/libraries/validation/008.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
$request = \Config\Services::request();
55

66
if ($validation->withRequest($request)->run()) {
7-
// If you want to get the validated data.
7+
// If you use the input data, you should get it from the getValidated() method.
8+
// Otherwise you may create a vulnerability.
89
$validData = $validation->getValidated();
910

1011
// ...

0 commit comments

Comments
 (0)