mirror of
https://github.com/php/php-src.git
synced 2026-04-28 18:53:33 +02:00
MFH: Fixed bug #21957 (serialize() mangles objects with __sleep).
This commit is contained in:
@@ -15,6 +15,7 @@ PHP 4 NEWS
|
||||
- Fixed bug #24142 (workaround for a gcc bug affecting round()). (Marcus, Ilia)
|
||||
- Fixed bug #24063 (serialize() missing 0 after the . on scientific notation).
|
||||
(Marcus, Ilia)
|
||||
- Fixed bug #21957 (serialize() mangles objects with __sleep). (Ilia)
|
||||
|
||||
07 Aug 2003, Version 4.3.3RC3
|
||||
- Fixed bug #24958 (Incorrect handling of 404s). (Ilia, Justin)
|
||||
|
||||
@@ -33,7 +33,7 @@ array(2) {
|
||||
["one"]=>
|
||||
string(3) "ABC"
|
||||
["two"]=>
|
||||
object(test)#1 (2) {
|
||||
object(test)(2) {
|
||||
["a"]=>
|
||||
int(7)
|
||||
["b"]=>
|
||||
|
||||
+4
-1
@@ -462,7 +462,7 @@ static void php_var_serialize_class(smart_str *buf, zval **struc, zval *retval_p
|
||||
"serialize.");
|
||||
/* we should still add element even if it's not OK,
|
||||
since we already wrote the length of the array before */
|
||||
smart_str_appendl(buf,"s:0:\"\";N;", 9);
|
||||
smart_str_appendl(buf,"N;", 2);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -543,6 +543,9 @@ static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *va
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only "
|
||||
"containing the names of instance-variables to "
|
||||
"serialize.");
|
||||
/* we should still add element even if it's not OK,
|
||||
since we already wrote the length of the array before */
|
||||
smart_str_appendl(buf,"N;", 2);
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&retval_ptr);
|
||||
|
||||
Reference in New Issue
Block a user