iliaa           Tue Jun 17 13:15:02 2003 EDT

  Modified files:              
    /php4/main  main.c 
  Log:
  Handle numeric keys passed via GPC
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.559 php4/main/main.c:1.560
--- php4/main/main.c:1.559      Sat Jun 14 11:08:26 2003
+++ php4/main/main.c    Tue Jun 17 13:15:02 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.559 2003/06/14 15:08:26 iliaa Exp $ */
+/* $Id: main.c,v 1.560 2003/06/17 17:15:02 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -1588,12 +1588,14 @@
                zval **data;
                char *string_key;
                uint string_key_len;
+               ulong num_key;
 
                zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(form_variables), &pos);
                while (zend_hash_get_current_data_ex(Z_ARRVAL_P(form_variables), (void 
**)&data, &pos) == SUCCESS) {
-                       zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), 
&string_key, &string_key_len, NULL, 0, &pos);
-
-                       ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), string_key, 
string_key_len, *data, (*data)->refcount+1, 0);
+                       /* we only register string keys, since we cannot have $1234 */
+                       if (zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), 
&string_key, &string_key_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING) {
+                               ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), 
string_key, string_key_len, *data, (*data)->refcount+1, 0);
+                       }
                        zend_hash_move_forward_ex(Z_ARRVAL_P(form_variables), &pos);
                }
        }



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

Reply via email to