behaviour of $_POST with Json after update of Apache2 and php

Viewed 71

Ok, So i have this rather strange question and I even can't say what is the source of it.

Previously I were running at php 5.5.9 and Apache/2.4.7 at Ubuntu and everything was working fine. Now we changed server to php 5.5.27 and Apache/2.4.10 at Debian.

About problem: On old configuration doing post request like this:

curl -i -d '{"secret":""}' -X POST url

didn't populate $_POST and everything was working fine. On new one I get $_POST array like this

(
    [{"secret":""}] => 
)

and it just mess up codeigniter sanitization of inputs, which ends up on

    if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
    {
        exit('Disallowed Key Characters.');
    }

Adding

-H "Content-Type: application/json"

to curl solves problem but it is no solution because request is done by old mobile application and I can't change it. I have run out of ideas and I simply don't know where at configs I should be looking. Or now this is working as expected and I can't change it and I just should overwrite codeigniter method?

Thanks for any help.

0 Answers
Related