summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--main/php_variables.c2
-rw-r--r--tests/basic/bug61000.phpt19
3 files changed, 22 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f80439f6b4..933e0d2ffe 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ PHP NEWS
(Nikic, Laruence)
. Fixed bug #61011 (Crash when an exception is thrown by __autoload
accessing a static property). (Laruence)
+ . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
+ vars). (Laruence)
- Standard:
. Fixed memory leak in substr_replace. (Pierrick)
diff --git a/main/php_variables.c b/main/php_variables.c
index 49e4f4aca2..427966170c 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -133,7 +133,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
if (track_vars_array) {
ht = Z_ARRVAL_P(track_vars_array);
- zend_hash_del(ht, var, var_len + 1);
+ zend_symtable_del(ht, var, var_len + 1);
}
zval_dtor(val);
diff --git a/tests/basic/bug61000.phpt b/tests/basic/bug61000.phpt
new file mode 100644
index 0000000000..8149d68e94
--- /dev/null
+++ b/tests/basic/bug61000.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #61000 (Exceeding max nesting level doesn't delete numerical vars)
+--INI--
+max_input_nesting_level=2
+--POST--
+1[a][]=foo&1[a][b][c]=bar
+--GET--
+a[a][]=foo&a[a][b][c]=bar
+--FILE--
+<?php
+print_r($_GET);
+print_r($_POST);
+--EXPECTF--
+Array
+(
+)
+Array
+(
+)