]> granicus.if.org Git - php/commitdiff
MFB minor consistency cleanup
authorRasmus Lerdorf <rasmus@php.net>
Wed, 10 Aug 2005 23:35:51 +0000 (23:35 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 10 Aug 2005 23:35:51 +0000 (23:35 +0000)
main/php_variables.c

index 765934fb3403c60e665673ab1878c9b9ced14bc8..507f0526baff0d25b9f220030e19149b65b789df 100644 (file)
@@ -61,7 +61,7 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra
 {
        char *p = NULL;
        char *ip;               /* index pointer */
-       char *index;
+       char *index, *escaped_index = NULL;
        int var_len, index_len;
        zval *gpc_element, **gpc_element_p;
        zend_bool is_array;
@@ -114,7 +114,7 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra
 
        while (1) {
                if (is_array) {
-                       char *escaped_index = NULL, *index_s;
+                       char *index_s;
                        int new_idx_len = 0;
 
                        ip++;
@@ -183,7 +183,6 @@ plain_var:
                                zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
                        } else {
                                zval **tmp;
-                               char *escaped_index;
 
                                if (PG(magic_quotes_gpc)) { 
                                        escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
@@ -198,13 +197,13 @@ plain_var:
                                 */
                                if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) && 
                                        zend_symtable_find(symtable1, escaped_index, index_len+1, (void **) &tmp) != FAILURE) {
-                                       if (PG(magic_quotes_gpc)) { 
+                                       if (index != escaped_index) {
                                                efree(escaped_index);
                                        }
                                        break;
                                }
                                zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
-                               if (PG(magic_quotes_gpc)) { 
+                               if (index != escaped_index) {
                                        efree(escaped_index);
                                }
                        }