the INPUT_POST Parameter of the PHP filter function filter_input_array() e.g. in
filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
seems to overwrite any modification applied to the superglobal $_POST.
test:
<?php
// 1.
$_POST['abc'] = '123';
var_dump($_POST);
// 2.
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
var_dump($_POST);
?>
output:
after // 2. your $_POST will be empty (as the initial POST was empty)
index.php:4:
array (size=1)
'abc' => string '123' (length=3)
index.php:8:null
so be sure, to put
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING, true);
on the top of your scripts!
Q: did anyone alse notice that behaviour - or did I made an error in reasoning?
Possible Answer: Data are taken from superglobal $_REQUEST an not from $_POST
INPUT_POST
is this list of contants, which just links to the page describing$_POST
, so that implies a connection to me. – RevisionistINPUT_POST
was irritating me, see my -> "Possible Answer:" at the end of the initial article. – Codee