Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong POST Data parse in PHP

I just have a very strange behaviour of HTTP POST method in php. An example below:

I create a file named post.php

// post.php
<?php 
    print_r($_POST);
    exit;
?>

And sending some data to this page via curl:

curl 'http://example.com/post.php' --data 'test=test2'

it returns:

Array
(
    [test] => test2test=test2
)

In case i send data with 2 or more keys:

curl 'http://example.com/post.php' --data 'test=test2' --data 't=1'

it returns:

Array
(
    [test] => test2
    [t] => 1
)

This problem arose after php upgrading.

Environment:
PHP - PHP 5.4.4-14+deb7u5
OS - Debian 6.0.3 64bit

Does anybody faced with problem like that?

like image 282
yetanotherrabbi Avatar asked Nov 01 '22 05:11

yetanotherrabbi


1 Answers

Was fixed after upgrading up to PHP 5.4.25-1

like image 160
yetanotherrabbi Avatar answered Nov 15 '22 05:11

yetanotherrabbi