Home  >  Article  >  Backend Development  >  php.ini中,max_input_nesting_level和max_input_vars两个限制如何理解?

php.ini中,max_input_nesting_level和max_input_vars两个限制如何理解?

WBOY
WBOYOriginal
2016-06-06 20:20:301733browse

我的网站只有一层变量,类似/index.php?a=a&b=b,不会出现/index.php?a[a]=aa&a[b]=ab的情况,个数也不超过2个。

但是经测试只有设置成下面的才不会报错:

<code>max_input_nesting_level=2</code>

首先这个我以为应该是=1,但是只有=2才不会出错;

<code>max_input_vars=36</code>

这个就更奇怪了,我没有那么多参数,为什么要36才不会出错。

以上使用下限我都是从0开始一个个试出来的。

另外,大家认为有必要为了防止用户错误输入路径,而把这个限制设得大一些吗?

回复内容:

我的网站只有一层变量,类似/index.php?a=a&b=b,不会出现/index.php?a[a]=aa&a[b]=ab的情况,个数也不超过2个。

但是经测试只有设置成下面的才不会报错:

<code>max_input_nesting_level=2</code>

首先这个我以为应该是=1,但是只有=2才不会出错;

<code>max_input_vars=36</code>

这个就更奇怪了,我没有那么多参数,为什么要36才不会出错。

以上使用下限我都是从0开始一个个试出来的。

另外,大家认为有必要为了防止用户错误输入路径,而把这个限制设得大一些吗?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn