summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-09-16 12:55:31 +0000
committerSascha Schumann <sas@php.net>1999-09-16 12:55:31 +0000
commitfa0f9ed36759a90fd047b961549ee2d9c5f7448c (patch)
tree3bcc6dce5024f04b9b158bdd9c6cc7b63677e1f9 /ext
parenta597f24b5e1894ccbb483dd75b79c42f85aedb34 (diff)
downloadphp-git-fa0f9ed36759a90fd047b961549ee2d9c5f7448c.tar.gz
wddx decode works as well
Diffstat (limited to 'ext')
-rw-r--r--ext/session/php_session.h2
-rw-r--r--ext/session/session.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index e8d6c5497c..f828f27932 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -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
diff --git a/ext/session/session.c b/ext/session/session.c
index 698f21d2ac..9b00f21604 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -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;
}
}