Doc #65659 [Com]: Wrong description of max_input_vars config var
| From: | leight+bugs dot php at gmail dot com | Date: | Thu, 12 Sep 2013 14:32:38 +0000 |
| Subject: | Doc #65659 [Com]: Wrong description of max_input_vars config var | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10257@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65659&edit=1
ID: 65659
Comment by: leight+bugs dot php at gmail dot com
Reported by: gabri dot ns at gmail dot com
Summary: Wrong description of max_input_vars config var
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
This is a duplicate of https://bugs.php.net/bug.php?id=62921
The documentation is fixed in the SVN, but is not live yet.
Previous Comments:
------------------------------------------------------------------------
[2013-09-12 14:08:21] leight+bugs dot php at gmail dot com
Looking at main/php_variables.c it appears that no attempt is made to discern
between nesting levels.
I wondered if this was a documentation issue, or a bug with the code not checking
nesting. It looks to be the documentation at fault.
------------------------------------------------------------------------
[2013-09-12 13:39:25] gabri dot ns at gmail dot com
Description:
------------
From http://www.php.net/manual/en/info.configuration.php#ini.max-input-vars
it stated that the limitation is only on each nested level of multidimensional
array. But actually, it limit on the root level of variabel. Easy speaking, it
count appearance of '&' in input.
this script should work since each level only contain 900 var, but it stopped
after 1000th appearance of '&'
it may be connected to Bug #60728
Test script:
---------------
$a = array();
for ($i = 0; $i < 900; $i++)
{
if ($i != 899) $a['asd'.$i] = "$i";
else for ($j = 0; $j < 900; $j++)
$a['asd'.$i]['qwe'.$j] = "$i - $j";
}
$a = http_build_query($a);
parse_str($a,$b);
$b = http_build_query($b);
echo count(explode('&',$a))."\n";
echo count(explode('&',$b))."\n";
Expected result:
----------------
1799
1799
Actual result:
--------------
Warning: parse_str(): Input variables exceeded 1000. To increase the limit change
max_input_vars in php.ini. in var://_POST/script on line 9
1799
1000
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65659&edit=1