iliaa           Wed Aug 10 18:36:25 2005 EDT

  Modified files:              
    /php-src/ext/wddx   wddx.c 
  Log:
  Fixed bug #34068 (Numeric string as array key not cast to integer in
  wddx_deserialize()).
  
  
http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.119&r2=1.120&ty=u
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.119 php-src/ext/wddx/wddx.c:1.120
--- php-src/ext/wddx/wddx.c:1.119       Wed Aug  3 10:08:20 2005
+++ php-src/ext/wddx/wddx.c     Wed Aug 10 18:36:20 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: wddx.c,v 1.119 2005/08/03 14:08:20 sniper Exp $ */
+/* $Id: wddx.c,v 1.120 2005/08/10 22:36:20 iliaa Exp $ */
 
 #include "php.h"
 
@@ -997,10 +997,20 @@
                                                ent1->data->refcount--;
                                                add_property_zval(ent2->data, 
ent1->varname, ent1->data);
                                                EG(scope) = old_scope;
-                                       } else
-                                               zend_hash_update(target_hash,
-                                                                               
 ent1->varname, strlen(ent1->varname)+1,
-                                                                               
 &ent1->data, sizeof(zval *), NULL);
+                                       } else {
+                                               long l;  
+                                               double d;
+                               
+                                               switch 
(is_numeric_string(ent1->varname, strlen(ent1->varname), &l, &d, 0)) {
+                                                       case IS_DOUBLE:
+                                                               l = (long) d;
+                                                       case IS_LONG:
+                                                               
zend_hash_index_update(target_hash, l, &ent1->data, sizeof(zval *), NULL);
+                                                               break;
+                                                       default:
+                                                               
zend_hash_update(target_hash,ent1->varname, strlen(ent1->varname)+1, 
&ent1->data, sizeof(zval *), NULL);
+                                               }
+                                       }
                                        efree(ent1->varname);
                                } else  {
                                        zend_hash_next_index_insert(target_hash,

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to