Skip to content

Commit 6293b6b

Browse files
committed
docs: add warning to getVar() in validation.rst
1 parent 6c187dd commit 6293b6b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,13 @@ For example, data returned by multi select dropdown:
343343
withRequest()
344344
=============
345345

346+
.. warning:: If you want to validate POST data only, don't use ``withRequest()``.
347+
This method uses :ref:`$request->getVar() <incomingrequest-getting-data>`
348+
which returns ``$_GET``, ``$_POST`` or ``$_COOKIE`` data in that order
349+
(depending on php.ini `request-order <https://www.php.net/manual/en/ini.core.php#ini.request-order>`_).
350+
Newer values override older values. POST values may be overridden by the
351+
cookies if they have the same name.
352+
346353
One of the most common times you will use the validation library is when validating
347354
data that was input from an HTTP Request. If desired, you can pass an instance of the
348355
current Request object and it will take all of the input data and set it as the

0 commit comments

Comments
 (0)