0

I send POST param with name "param.name"

If I read the php://input everything ok, but if I try to get param from an array $_POST['param.name'] that it is absent because the dot was replaced to underscore and I need to get param this way $_POST['param_name'].

Maybe some settings in PHP I should tune...

I use PHP 7.4.15

  • 1
    Does this answer your question? [Get PHP to stop replacing '.' characters in $\_GET or $\_POST arrays?](https://stackoverflow.com/questions/68651/get-php-to-stop-replacing-characters-in-get-or-post-arrays) – Aaron Morefield Apr 05 '21 at 20:52

1 Answers1

0

This is expected PHP behavior as mentioned in their official documentation. As far as I know, PHP applies this rule when parsing the $_POST superglobal because of reasons related to backwards compatibility (register_globals).

The reason for php://input showing your actual parameter name is because this is a raw input stream, showing data that has not yet been parsed by PHP. While $_POST data is parsed.

In short, avoid using dot notation for PHP input parameter naming or be willing to implement your own parsing mechanism in order to support it.