summaryrefslogtreecommitdiff
path: root/ext/xmlrpc/xmlrpc-epi-php.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xmlrpc/xmlrpc-epi-php.c')
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index 6af8009de..9a043e59e 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -51,7 +51,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xmlrpc-epi-php.c,v 1.39.2.4 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: xmlrpc-epi-php.c,v 1.39.2.7 2006/08/11 19:16:29 tony2001 Exp $ */
/**********************************************************************
* BUGS: *
@@ -300,7 +300,13 @@ static int add_zval(zval* list, const char* id, zval** val)
{
if (list && val) {
if (id) {
- return zend_hash_update(Z_ARRVAL_P(list), (char*) id, strlen(id) + 1, (void *) val, sizeof(zval **), NULL);
+ int id_len = strlen(id);
+ if (!(id_len > 1 && id[0] == '0') && is_numeric_string((char *)id, id_len, NULL, NULL, 0) == IS_LONG) {
+ long index = strtol(id, NULL, 0);
+ return zend_hash_index_update(Z_ARRVAL_P(list), index, (void *) val, sizeof(zval **), NULL);
+ } else {
+ return zend_hash_update(Z_ARRVAL_P(list), (char*) id, strlen(id) + 1, (void *) val, sizeof(zval **), NULL);
+ }
} else {
return zend_hash_next_index_insert(Z_ARRVAL_P(list), (void *) val, sizeof(zval **), NULL);
}