Skip to content

Commit 505b396

Browse files
TimZ99kenjis
authored andcommitted
Replaced deprecated FILTER_SANITIZE_STRING
Replaced with FILTER_SANITIZE_FULL_SPECIAL_CHARS. Equivalent to calling htmlspecialchars() with ENT_QUOTES set.
1 parent 27235a1 commit 505b396

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,15 @@ The methods provided by the parent classes that are available are:
399399
The second optional parameter lets you run the data through the PHP's
400400
filters. Pass in the desired filter type as the second parameter::
401401

402-
$request->getVar('some_data', FILTER_SANITIZE_STRING);
402+
$request->getVar('some_data', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
403403

404404
To return an array of all POST items call without any parameters.
405405

406406
To return all POST items and pass them through the filter, set the
407407
first parameter to null while setting the second parameter to the filter
408408
you want to use::
409409

410-
$request->getVar(null, FILTER_SANITIZE_STRING);
410+
$request->getVar(null, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
411411
// returns all POST items with string sanitation
412412

413413
To return an array of multiple POST parameters, pass all the required keys as an array::
@@ -417,7 +417,7 @@ The methods provided by the parent classes that are available are:
417417
Same rule applied here, to retrieve the parameters with filtering, set the second parameter to
418418
the filter type to apply::
419419

420-
$request->getVar(['field1', 'field2'], FILTER_SANITIZE_STRING);
420+
$request->getVar(['field1', 'field2'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
421421

422422
.. php:method:: getGet([$index = null[, $filter = null[, $flags = null]]])
423423
@@ -489,7 +489,7 @@ The methods provided by the parent classes that are available are:
489489
This method is identical to ``getPost()`` and ``getGet()``, only it fetches cookie data::
490490

491491
$request->getCookie('some_cookie');
492-
$request->getCookie('some_cookie', FILTER_SANITIZE_STRING); // with filter
492+
$request->getCookie('some_cookie', FILTER_SANITIZE_FULL_SPECIAL_CHARS); // with filter
493493

494494
To return an array of multiple cookie values, pass all the required keys as an array::
495495

0 commit comments

Comments
 (0)