Skip to content

Commit 1149f27

Browse files
committed
docs: add warning to getVar() in incomingrequest.rst
1 parent 6293b6b commit 1149f27

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ Getting Data
101101

102102
The ``getVar()`` method will pull from ``$_REQUEST``, so will return any data from ``$_GET``, ``$POST``, or ``$_COOKIE`` (depending on php.ini `request-order <https://www.php.net/manual/en/ini.core.php#ini.request-order>`_).
103103

104+
.. warning:: If you want to validate POST data only, don't use ``getVar()``.
105+
Newer values override older values. POST values may be overridden by the
106+
cookies if they have the same name, and you set "C" after "P" in
107+
`request-order <https://www.php.net/manual/en/ini.core.php#ini.request-order>`_.
108+
104109
.. note:: If the incoming request has a ``Content-Type`` header set to ``application/json``,
105110
the ``getVar()`` method returns the JSON data instead of ``$_REQUEST`` data.
106111

0 commit comments

Comments
 (0)