mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
This commit is contained in:
parent
0ee5d18f91
commit
7fcbe4d546
4
NEWS
4
NEWS
@ -12,6 +12,10 @@ PHP NEWS
|
||||
. Fixed bug #63389 (Missing context check on libxml_set_streams_context()
|
||||
causes memleak). (Laruence)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #63447 (max_input_vars doesn't filter variables when
|
||||
mbstring.encoding_translation = On). (Laruence)
|
||||
|
||||
- MySQL:
|
||||
. Fixed compilation failure on mixed 32/64 bit systems. (Andrey)
|
||||
|
||||
|
@ -262,6 +262,12 @@ enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_
|
||||
n++;
|
||||
var = php_strtok_r(NULL, info->separator, &strtok_buf);
|
||||
}
|
||||
|
||||
if (n > (PG(max_input_vars) * 2)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
|
||||
goto out;
|
||||
}
|
||||
|
||||
num = n; /* make sure to process initilized vars only */
|
||||
|
||||
/* initialize converter */
|
||||
|
20
ext/mbstring/tests/bug63447_001.phpt
Normal file
20
ext/mbstring/tests/bug63447_001.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
?>
|
||||
--INI--
|
||||
max_input_nesting_level=10
|
||||
max_input_vars=5
|
||||
mbstring.encoding_translation=1
|
||||
--POST--
|
||||
a=1&b=2&c=3&d=4&e=5&f=6
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST);
|
||||
?>
|
||||
--EXPECT--
|
||||
Warning: Unknown: Input variables exceeded 5. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
|
||||
array(0) {
|
||||
}
|
20
ext/mbstring/tests/bug63447_002.phpt
Normal file
20
ext/mbstring/tests/bug63447_002.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
?>
|
||||
--INI--
|
||||
max_input_nesting_level=10
|
||||
max_input_vars=4
|
||||
mbstring.encoding_translation=1
|
||||
--POST--
|
||||
a=1&b=2&c=3&d=4&e=5
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST);
|
||||
?>
|
||||
--EXPECT--
|
||||
Warning: Unknown: Input variables exceeded 4. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
|
||||
array(0) {
|
||||
}
|
34
ext/mbstring/tests/bug63447_003.phpt
Normal file
34
ext/mbstring/tests/bug63447_003.phpt
Normal file
@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
?>
|
||||
--INI--
|
||||
max_input_nesting_level=5
|
||||
max_input_vars=100
|
||||
mbstring.encoding_translation=1
|
||||
--POST--
|
||||
a=1&b[][][]=2&c[][][][][][]=7
|
||||
--FILE--
|
||||
<?php
|
||||
print_r($_POST);
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[a] => 1
|
||||
[b] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => 2
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
Loading…
Reference in New Issue
Block a user