laruence                                 Wed, 08 Feb 2012 14:07:27 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=323123

Log:
Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical vars).

Bug: https://bugs.php.net/61000 (Open) Exceeding max nesting level doesn't 
delete numerical vars
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/main/php_variables.c
    A   php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/main/php_variables.c
    A   php/php-src/trunk/tests/basic/bug61000.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-08 07:48:48 UTC (rev 323122)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-08 14:07:27 UTC (rev 323123)
@@ -16,6 +16,8 @@
   . Fix bug #60895 (Possible invalid handler usage in windows random
     functions). (Pierre)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)
+  . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical 
vars).
+    (Laruence)

 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

Modified: php/php-src/branches/PHP_5_3/main/php_variables.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/php_variables.c   2012-02-08 07:48:48 UTC 
(rev 323122)
+++ php/php-src/branches/PHP_5_3/main/php_variables.c   2012-02-08 14:07:27 UTC 
(rev 323123)
@@ -138,10 +138,10 @@

                                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);
                                } else if (PG(register_globals)) {
                                        ht = EG(active_symbol_table);
-                                       zend_hash_del(ht, var, var_len + 1);
+                                       zend_symtable_del(ht, var, var_len + 1);
                                }

                                zval_dtor(val);

Added: php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt                      
        (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt      2012-02-08 
14:07:27 UTC (rev 323123)
@@ -0,0 +1,38 @@
+--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
+(
+)
+--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
+(
+)

Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS      2012-02-08 07:48:48 UTC (rev 323122)
+++ php/php-src/trunk/NEWS      2012-02-08 14:07:27 UTC (rev 323123)
@@ -9,6 +9,8 @@
   . Fixed bug #60573 (type hinting with "self" keyword causes weird errors).
     (Laruence)
   . Fixed bug #60978 (exit code incorrect). (Laruence)
+  . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
+    vars). (Laruence)

 - cURL:
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,

Modified: php/php-src/trunk/main/php_variables.c
===================================================================
--- php/php-src/trunk/main/php_variables.c      2012-02-08 07:48:48 UTC (rev 
323122)
+++ php/php-src/trunk/main/php_variables.c      2012-02-08 14:07:27 UTC (rev 
323123)
@@ -133,7 +133,7 @@

                                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);

Added: php/php-src/trunk/tests/basic/bug61000.phpt
===================================================================
--- php/php-src/trunk/tests/basic/bug61000.phpt                         (rev 0)
+++ php/php-src/trunk/tests/basic/bug61000.phpt 2012-02-08 14:07:27 UTC (rev 
323123)
@@ -0,0 +1,38 @@
+--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
+(
+)
+--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
+(
+)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to