File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
user_guide_src/source/libraries Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -517,15 +517,18 @@ Validation Placeholders
517
517
=======================
518
518
519
519
The Validation class provides a simple method to replace parts of your rules based on data that's being passed into it. This
520
- sounds fairly obscure but can be especially handy with the ``is_unique `` validation rule. Placeholders are simply
520
+ sounds fairly obscure but can be especially handy with the ``is_unique `` validation rule.
521
+
522
+ Placeholders are simply
521
523
the name of the field (or array key) that was passed in as ``$data `` surrounded by curly brackets. It will be
522
524
replaced by the **value ** of the matched incoming field. An example should clarify this:
523
525
524
526
.. literalinclude :: validation/020.php
525
527
:lines: 2-
526
528
527
- .. note :: Since v4.3.5, you must set the validation rules for the placeholder
528
- field (the ``id `` field in the sample code above) for security.
529
+ .. warning :: Since v4.3.5, you must set the validation rules for the placeholder
530
+ field (the ``id `` field in the sample code above) for security reasons. Because
531
+ attackers can send any data to your application.
529
532
530
533
In this set of rules, it states that the email address should be unique in the database, except for the row
531
534
that has an id matching the placeholder's value. Assuming that the form POST data had the following:
You can’t perform that action at this time.
0 commit comments