From 626a7747b361f1d09e2135bda797c3a545004b6f Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 6 Nov 2023 08:03:48 +0900 Subject: [PATCH 1/2] docs: fix incorrect label position --- user_guide_src/source/libraries/validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() ============= From 75907cff0152c47201f4cdd16d8f0a0f9732b7e0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 6 Nov 2023 08:04:05 +0900 Subject: [PATCH 2/2] docs: fix comment in sample code --- user_guide_src/source/libraries/validation/008.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); // ...