@@ -201,10 +201,17 @@ Config for Validation
201201Traditional and Strict Rules
202202============================
203203
204- CI4 has two kinds of Validation rule classes.
205- The default rule classes (**Traditional Rules **) have the namespace ``CodeIgniter\Validation ``,
204+ CodeIgniter 4 has two kinds of Validation rule classes.
205+ The traditional rule classes (**Traditional Rules **) have the namespace ``CodeIgniter\Validation ``,
206206and the new classes (**Strict Rules **) have ``CodeIgniter\Validation\StrictRules ``, which provide strict validation.
207207
208+ .. note :: Since v4.3.0, **Strict Rules** are used by default for better security.
209+
210+ Traditional Rules
211+ -----------------
212+
213+ .. warning :: When validating data that contains non-string values, such as JSON data, it is recommended to use **Strict Rules**.
214+
208215The **Traditional Rules ** implicitly assume that string values are validated,
209216and the input value may be converted implicitly to a string value.
210217It works for most basic cases like validating POST data.
@@ -213,14 +220,17 @@ However, for example, if you use JSON input data, it may be a type of bool/null/
213220When you validate the boolean ``true ``, it is converted to string ``'1' `` with the Traditional rule classes.
214221If you validate it with the ``integer `` rule, ``'1' `` passes the validation.
215222
216- The **Strict Rules ** don't use implicit type conversion.
223+ Strict Rules
224+ ------------
217225
218- .. warning :: When validating data that contains non-string values, such as JSON data, it is recommended to use **Strict Rules**.
226+ .. versionadded :: 4.2.0
227+
228+ The **Strict Rules ** don't use implicit type conversion.
219229
220- Using Strict Rules
221- ------------------
230+ Using Traditional Rules
231+ -----------------------
222232
223- If you want to use these rules, you need to change the rule classes in **app/Config/Validation.php **:
233+ If you want to use traditional rules, you need to change the rule classes in **app/Config/Validation.php **:
224234
225235.. literalinclude :: validation/003.php
226236
0 commit comments