]> granicus.if.org Git - php/commitdiff
Fixed bug #32802 (broken MFH)
authorIlia Alshanetsky <iliaa@php.net>
Tue, 17 May 2005 18:42:35 +0000 (18:42 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 17 May 2005 18:42:35 +0000 (18:42 +0000)
main/php_variables.c

index cf9d98cc6300161c360e219e6c861e3b7d22c00a..f5c8711ae7f9a0560e5bb760b05880030c746940 100644 (file)
@@ -182,11 +182,25 @@ plain_var:
                        if (!index) {
                                zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
                        } else {
+                               zval **tmp;
+                       
                                if (PG(magic_quotes_gpc) && (index!=var)) {
                                        char *escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
+                                       
+                                       if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) && 
+                                                       zend_hash_find(symtable1, escaped_index, index_len+1, (void **) &tmp) != FAILURE) {
+                                               efree(escaped_index);
+                                               break;
+                                       }
+                                       
                                        zend_hash_update(symtable1, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
                                        efree(escaped_index);
                                } else {
+                                       if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) && 
+                                                       zend_hash_find(symtable1, index, index_len+1, (void **) &tmp) != FAILURE) {
+                                               break;
+                                       }
+                               
                                        zend_hash_update(symtable1, index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
                                }
                        }