Bug #71961 [NEW]: $POST do not have empty variables
| From: | pyo at mail dot ru | Date: | Mon, 04 Apr 2016 21:29:37 +0000 |
| Subject: | Bug #71961 [NEW]: $POST do not have empty variables | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-200357@lists.php.net to get a copy of this message | ||
From: pyo at mail dot ru
Operating system: centos
PHP version: 5.6.20
Package: CGI/CLI related
Bug Type: Bug
Bug description:$POST do not have empty variables
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 bug report at https://bugs.php.net/bug.php?id=71961&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71961&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71961&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71961&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71961&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71961&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71961&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71961&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71961&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71961&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71961&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71961&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71961&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71961&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71961&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71961&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71961&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71961&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71961&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71961&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71961&r=mysqlcfg