Skip to content

Commit 56990e6

Browse files
committed
docs: improve note for Validation placeholder
1 parent 5ebe2b7 commit 56990e6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

user_guide_src/source/libraries/validation.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,18 @@ Validation Placeholders
517517
=======================
518518

519519
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
521523
the name of the field (or array key) that was passed in as ``$data`` surrounded by curly brackets. It will be
522524
replaced by the **value** of the matched incoming field. An example should clarify this:
523525

524526
.. literalinclude:: validation/020.php
525527
:lines: 2-
526528

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.
529532

530533
In this set of rules, it states that the email address should be unique in the database, except for the row
531534
that has an id matching the placeholder's value. Assuming that the form POST data had the following:

0 commit comments

Comments
 (0)