dmitry Wed Jun 1 07:03:43 2005 EDT
Modified files:
/php-src/ext/standard var.c var_unserializer.c var_unserializer.re
Log:
Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if
object is overloaded)
http://cvs.php.net/diff.php/php-src/ext/standard/var.c?r1=1.198&r2=1.199&ty=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.198 php-src/ext/standard/var.c:1.199
--- php-src/ext/standard/var.c:1.198 Wed Feb 23 06:17:52 2005
+++ php-src/ext/standard/var.c Wed Jun 1 07:03:42 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.198 2005/02/23 11:17:52 stas Exp $ */
+/* $Id: var.c,v 1.199 2005/06/01 11:03:42 dmitry Exp $ */
/* {{{ includes
@@ -696,7 +696,8 @@
return;
}
- if(Z_OBJCE_PP(struc) != PHP_IC_ENTRY) {
+ if (Z_OBJCE_PP(struc) != PHP_IC_ENTRY &&
+
zend_hash_exists(&Z_OBJCE_PP(struc)->function_table, "__sleep",
sizeof("__sleep"))) {
INIT_PZVAL(&fname);
ZVAL_STRINGL(&fname, "__sleep",
sizeof("__sleep") - 1, 0);
res =
call_user_function_ex(CG(function_table), struc, &fname,
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.64&r2=1.65&ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.64
php-src/ext/standard/var_unserializer.c:1.65
--- php-src/ext/standard/var_unserializer.c:1.64 Tue May 31 05:41:46 2005
+++ php-src/ext/standard/var_unserializer.c Wed Jun 1 07:03:42 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var_unserializer.c,v 1.64 2005/05/31 09:41:46 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.65 2005/06/01 11:03:42 dmitry Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
@@ -325,7 +325,8 @@
return 0;
}
- if(Z_OBJCE_PP(rval) != PHP_IC_ENTRY) {
+ if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY &&
+ zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup",
sizeof("__wakeup"))) {
INIT_PZVAL(&fname);
ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0);
call_user_function_ex(CG(function_table), rval, &fname,
&retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.50&r2=1.51&ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.50
php-src/ext/standard/var_unserializer.re:1.51
--- php-src/ext/standard/var_unserializer.re:1.50 Tue May 31 05:41:36 2005
+++ php-src/ext/standard/var_unserializer.re Wed Jun 1 07:03:42 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var_unserializer.re,v 1.50 2005/05/31 09:41:36 sniper Exp $ */
+/* $Id: var_unserializer.re,v 1.51 2005/06/01 11:03:42 dmitry Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
@@ -329,7 +329,8 @@
return 0;
}
- if(Z_OBJCE_PP(rval) != PHP_IC_ENTRY) {
+ if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY &&
+ zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup",
sizeof("__wakeup"))) {
INIT_PZVAL(&fname);
ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0);
call_user_function_ex(CG(function_table), rval, &fname,
&retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php