mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
wddx decode works as well
This commit is contained in:
parent
a597f24b5e
commit
fa0f9ed367
2 changed files with 6 additions and 4 deletions
|
@ -148,11 +148,9 @@ void session_adapt_uris(const char *, uint, char **, uint *);
|
|||
#define session_adapt_uris(a,b,c,d) do { } while(0)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if HAVE_WDDX
|
||||
#define WDDX_SERIALIZER
|
||||
#include "ext/wddx/php_wddx_api.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -214,7 +214,6 @@ PS_SERIALIZER_ENCODE_FUNC(wddx)
|
|||
wddx_packet *packet;
|
||||
char *key;
|
||||
zval **struc;
|
||||
char *buf;
|
||||
ELS_FETCH();
|
||||
|
||||
packet = _php_wddx_constructor();
|
||||
|
@ -250,13 +249,14 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
|
|||
char tmp[128];
|
||||
ulong idx;
|
||||
int hash_type;
|
||||
int dofree = 1;
|
||||
ELS_FETCH();
|
||||
|
||||
if(vallen == 0) return FAILURE;
|
||||
|
||||
MAKE_STD_ZVAL(retval);
|
||||
|
||||
_php_wddx_deserialize(val, retval);
|
||||
_php_wddx_deserialize_ex(val, vallen, retval);
|
||||
|
||||
for(zend_hash_internal_pointer_reset(retval->value.ht);
|
||||
zend_hash_get_current_data(retval->value.ht, (void **) &ent) == SUCCESS;
|
||||
|
@ -267,10 +267,14 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
|
|||
case HASH_KEY_IS_LONG:
|
||||
sprintf(tmp, "%ld", idx);
|
||||
key = tmp;
|
||||
dofree = 0;
|
||||
case HASH_KEY_IS_STRING:
|
||||
zval_add_ref(ent);
|
||||
zend_hash_update(&EG(symbol_table), key, strlen(key) + 1,
|
||||
ent, sizeof(ent), NULL);
|
||||
PS_ADD_VAR(key);
|
||||
if(dofree) efree(key);
|
||||
dofree = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue