diff options
author | Andrey Hristov <andrey@php.net> | 1999-08-18 16:43:57 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 1999-08-18 16:43:57 +0000 |
commit | 3f48a5524d408dd02633dfa4247759981c85d64c (patch) | |
tree | 98a703051f255c6b86363ae67660562cb41e745f | |
parent | f63da06238585ec3a482e9646b5579dcdfa1c8cb (diff) | |
download | php-git-3f48a5524d408dd02633dfa4247759981c85d64c.tar.gz |
Ported fixed for bug #2103 from PHP3.
-rw-r--r-- | ext/wddx/wddx.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index a14f4e3f06..7ecdc1bff9 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -463,6 +463,7 @@ static void _php_wddx_push_element(void *user_data, const char *name, const char ent.varname = NULL; ent.data = (zval *)emalloc(sizeof(zval)); + ent.data->value.str.val = NULL; ent.data->value.str.len = 0; INIT_PZVAL(ent.data); wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); @@ -546,7 +547,7 @@ static void _php_wddx_pop_element(void *user_data, const char *name) ent1->varname, strlen(ent1->varname)+1, &ent1->data, sizeof(zval *), NULL); efree(ent1->varname); - } else { + } else { zend_hash_next_index_insert(ent2->data->value.ht, &ent1->data, sizeof(zval *), NULL); @@ -555,6 +556,8 @@ static void _php_wddx_pop_element(void *user_data, const char *name) efree(ent1); } } + else if (!strcmp(name, EL_VAR) && stack->varname) + efree(stack->varname); } /* }}} */ @@ -835,7 +838,11 @@ PHP_FUNCTION(wddx_deserialize) if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &packet) == FAILURE) { WRONG_PARAM_COUNT; } - + + convert_to_string(packet); + if (packet->value.str.len == 0) + return; + _php_wddx_deserialize(packet, return_value); } /* }}} */ |