#49983 [NEW]: PHP silently discards POST variables after 1000 variables.
| From: | dgrace at wingsnw dot com | Date: | Sat, 24 Oct 2009 01:51:52 +0000 |
| Subject: | #49983 [NEW]: PHP silently discards POST variables after 1000 variables. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-143892@lists.php.net to get a copy of this message | ||
From: dgrace at wingsnw dot com
Operating system: Debian Linux
PHP version: 5.2.11
PHP Bug Type: Unknown/Other Function
Bug description: PHP silently discards POST variables after 1000 variables.
Description:
------------
PHP will quietly discard variables POSTed to a form after the 1000th
posted variable. This value seems to be consistent and is not affected by
post_max_size.
I've searched the documentation about php.ini directives and could not
find anything suggesting this limit can be changed.
This is especially problematic if presenting a list of items to be
selected by the user (i.e. listing 1000+ items with an option to delete the
selected items). The discard occurs regardless of the POST variable names
-- i.e. if they are all named "id[]" to convert to an array, the failure
will still happen.
Tested with both IE7 and FF3.5.3 to confirm that it was not a browser
limitation.
Tested on Apache/2.2.13 (Debian)
Reproduce code:
---------------
<?php
/* Test case for bug report: See how many POST variables make it back to
PHP. */
error_reporting(E_ALL);
$numvars = 10000;
echo '<html><body>';
echo '<p>$_POST contained ', ((int) @count($_POST)), ' out of ', $numvars,
' variable(s)</p>';
echo "<form action=\"?\" method=\"post\">";
for($n = 0 ; $n < $numvars; ++$n) { echo '<input type="hidden"
name="v',
$n, '" value="0" />'; }
echo '<input type="submit" name="submit" value="Run Test"
/>';
echo '</form>';
echo '</body></html>';
Expected result:
----------------
After submitting the form once, 10001 out of 10000 variables (since the
submit button itself is an additional _POST variable, the count would be
off in this case)
Actual result:
--------------
1000 of 10000 variables
--
Edit bug report at http://bugs.php.net/?id=49983&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49983&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49983&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49983&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49983&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49983&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49983&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49983&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49983&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49983&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49983&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49983&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49983&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49983&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49983&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49983&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49983&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49983&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49983&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49983&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49983&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49983&r=mysqlcfg