cvs: php4(PHP_4_0_7) / NEWS /ext/wddx wddx.c
| From: | Andrei Zmievski | Date: | Sun, 18 Nov 2001 01:23:14 +0000 |
| Subject: | cvs: php4(PHP_4_0_7) / NEWS /ext/wddx wddx.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8232@lists.php.net to get a copy of this message | ||
andrei Sat Nov 17 20:23:14 2001 EDT
Modified files: (Branch: PHP_4_0_7)
/php4 NEWS
/php4/ext/wddx wddx.c
Log:
MFH
Index: php4/NEWS
diff -u php4/NEWS:1.737.2.14 php4/NEWS:1.737.2.15
--- php4/NEWS:1.737.2.14 Sat Nov 10 19:08:33 2001
+++ php4/NEWS Sat Nov 17 20:23:14 2001
@@ -1,6 +1,8 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, Version 4.1.0
+- Fixed a bug in WDDX deserialization that would sometimes corrupp the root
+ element if it was a scalar one. (Andrei)
- Make ImageColorAt() and ImageColorsForIndex() work with TrueColor images.
(Rasmus)
- Fixed a bug preg_match_all() that would return results under improper indices
Index: php4/ext/wddx/wddx.c
diff -u php4/ext/wddx/wddx.c:1.79.2.3 php4/ext/wddx/wddx.c:1.79.2.4
--- php4/ext/wddx/wddx.c:1.79.2.3 Sat Oct 27 02:28:44 2001
+++ php4/ext/wddx/wddx.c Sat Nov 17 20:23:14 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: wddx.c,v 1.79.2.3 2001/10/27 06:28:44 sniper Exp $ */
+/* $Id: wddx.c,v 1.79.2.4 2001/11/18 01:23:14 andrei Exp $ */
#include "php.h"
#include "php_wddx.h"
@@ -80,6 +80,7 @@
typedef struct {
int top, max;
char *varname;
+ zend_bool done;
void **elements;
} wddx_stack;
@@ -129,6 +130,7 @@
} else {
stack->max = STACK_BLOCK_SIZE;
stack->varname = NULL;
+ stack->done = 0;
return SUCCESS;
}
}
@@ -382,7 +384,7 @@
break;
default:
- if (iscntrl((int)*p)) {
+ if (iscntrl((int)*p) && *p != '\n') {
FLUSH_BUF();
sprintf(control_buf, WDDX_CHAR, *p);
php_wddx_add_chunk(packet, control_buf);
@@ -884,7 +886,8 @@
}
}
efree(ent1);
- }
+ } else
+ stack->done = 1;
} else if (!strcmp(name, EL_VAR) && stack->varname) {
efree(stack->varname);
}
@@ -901,7 +904,7 @@
int decoded_len;
TSRMLS_FETCH();
- if (!wddx_stack_is_empty(stack)) {
+ if (!wddx_stack_is_empty(stack) && !stack->done) {
wddx_stack_top(stack, (void**)&ent);
switch (Z_TYPE_P(ent)) {
case ST_STRING: