cvs: /php4/ext/wddx wddx.c
| From: | Andrei Zmievski | Date: | Thu, 04 May 2000 20:28:21 +0000 |
| Subject: | cvs: /php4/ext/wddx wddx.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14495@lists.php.net to get a copy of this message | ||
andrei Thu May 4 13:28:21 2000 EDT
Modified files:
/php4/ext/wddx wddx.c
Log:
Got rid of infinite recursion when serializing $GLOBALS[].
@- Fixed infinite recursion when serializing $GLOBALS[] in WDDX. (Andrei)
Index: php4/ext/wddx/wddx.c
diff -u php4/ext/wddx/wddx.c:1.33 php4/ext/wddx/wddx.c:1.34
--- php4/ext/wddx/wddx.c:1.33 Thu May 4 13:00:07 2000
+++ php4/ext/wddx/wddx.c Thu May 4 13:28:21 2000
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: wddx.c,v 1.33 2000/05/04 20:00:07 andrei Exp $ */
+/* $Id: wddx.c,v 1.34 2000/05/04 20:28:21 andrei Exp $ */
#include "php.h"
#include "php_wddx.h"
@@ -415,7 +415,11 @@
}
}
- while(zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS) {
+ for (;zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS;
+ zend_hash_move_forward(target_hash)) {
+ if (*ent == var)
+ continue;
+
if (var->type == IS_OBJECT || hash_type == HASH_KEY_IS_STRING) {
ent_type = zend_hash_get_current_key(target_hash, &key, &idx);
@@ -428,8 +432,6 @@
}
} else
php_wddx_serialize_var(packet, *ent, NULL);
-
- zend_hash_move_forward(target_hash);
}
if (var->type == IS_OBJECT || hash_type == HASH_KEY_IS_STRING) {