cvs: php4(PHP_4_0_7) /ext/standard var.c

From: Date: Sat, 01 Dec 2001 15:22:24 +0000
Subject: cvs: php4(PHP_4_0_7) /ext/standard var.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8349@lists.php.net to get a copy of this message
thies Sat Dec 1 10:22:24 2001 EDT Modified files: (Branch: PHP_4_0_7) /php4/ext/standard var.c Log: fix problem when __sleep() returned non-existant variables Index: php4/ext/standard/var.c diff -u php4/ext/standard/var.c:1.113.2.1 php4/ext/standard/var.c:1.113.2.2 --- php4/ext/standard/var.c:1.113.2.1 Tue Aug 21 14:14:37 2001 +++ php4/ext/standard/var.c Sat Dec 1 10:22:24 2001 @@ -210,6 +210,10 @@ ulong index; HashPosition pos; int i; + zval nval, *nvalp; + + ZVAL_NULL(&nval); + nvalp = &nval; zend_hash_internal_pointer_reset_ex(HASH_OF(retval_ptr), &pos); @@ -230,11 +234,13 @@ continue; } + php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); + if (zend_hash_find(Z_OBJPROP_PP(struc), Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) { - php_var_serialize_string(buf, Z_STRVAL_PP(name), - Z_STRLEN_PP(name)); php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); + } else { + php_var_serialize_intern(buf, &nvalp, var_hash TSRMLS_CC); } } }

« previous php.cvs (#8349) next »