cvs: ZendEngine2 / zend_object_handlers.c

[email protected] ("Antony Dovgal")
Newsgroups php.zend-engine.cvs
Message-ID <cvstony20011205766328@cvsserver>
tony2001		Mon Mar 17 15:05:28 2008 UTC

  Modified files:              
    /ZendEngine2	zend_object_handlers.c 
  Log:
  return empty string of correct type if __toString() returned invalid value
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_object_handlers.c?r1=1.197&r2=1.198&diff_format=u
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.197 ZendEngine2/zend_object_handlers.c:1.198
--- ZendEngine2/zend_object_handlers.c:1.197	Mon Mar 17 14:53:43 2008
+++ ZendEngine2/zend_object_handlers.c	Mon Mar 17 15:05:28 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_object_handlers.c,v 1.197 2008/03/17 14:53:43 tony2001 Exp $ */
+/* $Id: zend_object_handlers.c,v 1.198 2008/03/17 15:05:28 tony2001 Exp $ */
 
 #include "zend.h"
 #include "zend_globals.h"
@@ -1260,7 +1260,11 @@
 					if (readobj == writeobj) {
 						zval_dtor(readobj);
 					}
-					ZVAL_EMPTY_STRING(writeobj);
+					if (type == IS_UNICODE) {
+						ZVAL_EMPTY_UNICODE(writeobj);
+					} else {
+						ZVAL_EMPTY_STRING(writeobj);
+					}
 					zend_error(E_RECOVERABLE_ERROR, "Method %v::__toString() must return a string value", ce->name);
 					return SUCCESS;
 				}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.