Bug #71961 [Com]: $POST do not have empty variables

From: Date: Wed, 20 Apr 2016 14:49:51 +0000
Subject: Bug #71961 [Com]: $POST do not have empty variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200661@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 Comment by: denisalustau at gmail dot com Reported by: pyo at mail dot ru Summary: $POST do not have empty variables Status: Open Type: Bug Package: CGI/CLI related Operating System: centos PHP Version: 5.6.20 Block user comment: N Private report: N New Comment: Checks this link: https://github.com/stefanesser/suhosin/issues/98 I hope that help you Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#200661) next »