php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71961 $POST do not have empty variables
Submitted: 2016-04-04 21:29 UTC Modified: 2016-04-20 15:51 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: pyo at mail dot ru Assigned:
Status: Closed Package: CGI/CLI related
PHP Version: 5.6.20 OS: centos
Private report: No CVE-ID: None
 [2016-04-04 21:29 UTC] 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"
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-20 14:49 UTC] denisalustau at gmail dot com
Checks this link: https://github.com/stefanesser/suhosin/issues/98

I hope that help you
 [2016-04-20 15:51 UTC] pyo at mail dot ru
-Status: Open +Status: Closed
 [2016-04-20 15:51 UTC] pyo at mail dot ru
Thank you. It's a suhosin bug :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC