Bug #71961 [Opn->Csd]: $POST do not have empty variables
| From: | pyo at mail dot ru | Date: | Wed, 20 Apr 2016 15:51:40 +0000 |
| Subject: | Bug #71961 [Opn->Csd]: $POST do not have empty variables | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200666@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71961&edit=1
ID: 71961
User updated by: pyo at mail dot ru
Reported by: pyo at mail dot ru
Summary: $POST do not have empty variables
-Status: Open
+Status: Closed
Type: Bug
Package: CGI/CLI related
Operating System: centos
PHP Version: 5.6.20
Block user comment: N
Private report: N
New Comment:
Thank you. It's a suhosin bug :)
Previous Comments:
------------------------------------------------------------------------
[2016-04-20 14:49:49] denisalustau at gmail dot com
Checks this link: https://github.com/stefanesser/suhosin/issues/98
I hope that help you
------------------------------------------------------------------------
[2016-04-04 21:29:35] pyo at mail dot ru
Description:
------------
In CGI mode $_POST is not filled with all passed variables. As Apache module works as expected.
Test script:
---------------
<?php
$fp = fopen('php://input', 'r');
echo stream_get_contents($fp).PHP_EOL;
var_dump($_POST);
Expected result:
----------------
% curl --data "lname=a&lpwd=%251&signin=" testscript.php
lname=a&lpwd=%251&signin=
array(3) {
["lname"]=>
string(1) "a"
["lpwd"]=>
string(2) "%1"
["signin"]=>
string(0) ""
}
% curl --data "lname=&lpwd=%251&signin=" testscript.php
lname=&lpwd=%251&signin=
array(1) {
["lname"]=>
string(0) ""
["lpwd"]=>
string(2) "%1"
["signin"]=>
string(0) ""
}
Actual result:
--------------
% curl --data "lname=a&lpwd=%251&signin=" testscript.php
lname=a&lpwd=%251&signin=
array(3) {
["lname"]=>
string(1) "a"
["lpwd"]=>
string(2) "%1"
["signin"]=>
string(0) ""
}
% curl --data "lname=&lpwd=%251&signin=" testscript.php
lname=&lpwd=%251&signin=
array(1) {
["lpwd"]=>
string(2) "%1"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71961&edit=1