iliaa           Wed Aug 10 18:39:13 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/wddx   wddx.c 
  Log:
  MFH: Fixed bug #34068 (Numeric string as array key not cast to integer in
  wddx_deserialize()).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.23&r2=1.1247.2.920.2.24&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.23 php-src/NEWS:1.1247.2.920.2.24
--- php-src/NEWS:1.1247.2.920.2.23      Wed Aug 10 06:37:03 2005
+++ php-src/NEWS        Wed Aug 10 18:39:10 2005
@@ -1,6 +1,8 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2005, Version 4.4.1
+- Fixed bug #34068 (Numeric string as array key not cast to integer in 
+  wddx_deserialize()). (Ilia)
 - Fixed bug #34064 (arr[] as param to function is allowed only if function 
   receives argument by reference). (Dmitry)
 - Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP). (Dmitry)
http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.96.2.6&r2=1.96.2.6.2.1&ty=u
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.96.2.6 php-src/ext/wddx/wddx.c:1.96.2.6.2.1
--- php-src/ext/wddx/wddx.c:1.96.2.6    Tue Jun 29 21:12:09 2004
+++ php-src/ext/wddx/wddx.c     Wed Aug 10 18:39:12 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: wddx.c,v 1.96.2.6 2004/06/30 01:12:09 iliaa Exp $ */
+/* $Id: wddx.c,v 1.96.2.6.2.1 2005/08/10 22:39:12 iliaa Exp $ */
 
 #include "php.h"
 #include "php_wddx.h"
@@ -979,10 +979,20 @@
                                                
                                                /* Clean up class name var 
entry */
                                                zval_ptr_dtor(&ent1->data);
-                                       } 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