Edit report at https://bugs.php.net/bug.php?id=55810&edit=1

 ID:                 55810
 Comment by:         the dot aloner at gmail dot com
 Reported by:        clemens dot schwaighofer at e-graphics dot com
 Summary:            cannot have more than 1000 entries in the _POST
                     array
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for your reply.
Yes, I've added this to php.ini and restarted Apache
max_input_vars = 3000
The setting has been changed, but the problem is still there. It doesn't allow 
more than 1000 vars. :(


Previous Comments:
------------------------------------------------------------------------
[2012-06-14 00:48:42] clemens dot schwaighofer at e-graphics dot com

@the dot aloner at gmail dot com

Yes, in the PHP ini search for "max_input_vars =" and up the value. Or add the 
entry if it is missing.

------------------------------------------------------------------------
[2012-06-13 13:52:39] the dot aloner at gmail dot com

I'm having this problem on 5.3.13 without Suhosin. Is there anything I can 
check?

Here is the result of the test:

PHP VERSION: 50313
Original data: 1010
POST DATA: 1000
ERROR: POST count is smaller than original data count

------------------------------------------------------------------------
[2011-09-30 01:15:05] clemens dot schwaighofer at e-graphics dot com

Actually it is not only the post.max_vars, but also the request.max_vars

------------------------------------------------------------------------
[2011-09-29 13:45:37] cataphr...@php.net

This is due to suhosin (see suhosin.post.max_vars). Note that we do NOT provide 
support for suhosin.

------------------------------------------------------------------------
[2011-09-29 06:57:19] clemens dot schwaighofer at e-graphics dot com

Description:
------------
System is PHP 5.3.8 on Apache 2.2.x on various systems. Debian packages and 
self compiled packages.

Problem:
If a script sends more than 1000 _POST entries everything above 1000 is ignore. 
This bug does not exist in 5.3.5, but also appears in 5.3.6

The Post MAX size is on all systems at least 20MB or more, but the size does 
not matter it is the element count in _POST that triggers the error

Test script:
---------------
<?

// possible bug in php 5.3.6-13 of debian/testing
// too large post data gets truncated

// write POST log
$fp = fopen(getcwd().'/DEBUG.LOG', 'a');
fwrite($fp, '['.date('Y-m-d H:i:s').'] ====>'."\n");
fwrite($fp, var_export($_POST, true)."\n");
fwrite($fp, '['.date('Y-m-d H:i:s').'] ====>'."\n");
fclose($fp);

// test if limit is really 1000
for ($i = 1; $i <= 1010; $i ++)
{
    $data['pos_'.$i] = 'DATA: '.$i;
}

?>
<html>
<head>
    <title>POST debug test</title>
</head>

<body>
PHP VERSION: <?=PHP_VERSION_ID;?><br>
<div style="color: red;">
<?
if (is_array($_POST))
{
    print "Original data: ".count($data)."<br>";
    print "POST DATA: ".count($_POST)."<br>";
    if (count($_POST) < count($data))
        print "ERROR: POST count is smaller than original data count<br>";
}
?>
</div>
<form method="post">
<?
    foreach ($data as $key => $value)
    {
?>
    <input type="hidden" name="<?=$key;?>" value="<?=urldecode($value);?>">
<?
    }
?>
    <input type="submit" name="send_post" value="Send POST">
</form>
</body>
</html>

Expected result:
----------------
_POST should keep all the sent entries and not cut at 1000.

PHP VERSION: 50305
Original data: 1010
POST DATA: 1032

Actual result:
--------------
_POST truncates all above >1000

PHP VERSION: 50306
Original data: 1010
POST DATA: 1000
ERROR: POST count is smaller than original data count

PHP VERSION: 50308
Original data: 1010
POST DATA: 1000
ERROR: POST count is smaller than original data count


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55810&edit=1

Reply via email to