helly Sun Sep 5 13:37:57 2004 EDT Modified files: /php-src/ext/standard incomplete_class.c Log: - Bugfix #29985 http://cvs.php.net/diff.php/php-src/ext/standard/incomplete_class.c?r1=1.24&r2=1.25&ty=u Index: php-src/ext/standard/incomplete_class.c diff -u php-src/ext/standard/incomplete_class.c:1.24 php-src/ext/standard/incomplete_class.c:1.25 --- php-src/ext/standard/incomplete_class.c:1.24 Wed Apr 7 04:06:09 2004 +++ php-src/ext/standard/incomplete_class.c Sun Sep 5 13:37:57 2004 @@ -17,7 +17,7 @@ */ -/* $Id: incomplete_class.c,v 1.24 2004/04/07 08:06:09 stas Exp $ */ +/* $Id: incomplete_class.c,v 1.25 2004/09/05 17:37:57 helly Exp $ */ #include "php.h" #include "basic_functions.h" @@ -26,39 +26,33 @@ #define INCOMPLETE_CLASS_MSG \ "The script tried to execute a method or " \ "access a property of an incomplete object. " \ - "Please ensure that the class definition <b>%s</b> of the object " \ + "Please ensure that the class definition \"%s\" of the object " \ "you are trying to operate on was loaded _before_ " \ - "the session was started" + "unserialize() gets called or provide a __autoload() function " \ + "to load the class definition " static zend_object_handlers php_incomplete_object_handlers; /* {{{ incomplete_class_message */ -static void incomplete_class_message(int error_type TSRMLS_DC) +static void incomplete_class_message(zval *object, int error_type TSRMLS_DC) { - char buf[1024]; - char *class_name = NULL; + char *class_name; - if(EG(This)) { - class_name = php_lookup_class_name(EG(This), NULL); - } + class_name = php_lookup_class_name(object, NULL); if (!class_name) { - class_name = estrndup("unknown", sizeof("unknown")-1); + class_name = "unknown"; } - snprintf(buf, sizeof(buf)-1, INCOMPLETE_CLASS_MSG, class_name); - - efree(class_name); - - php_error_docref(NULL TSRMLS_CC, error_type, "%s", buf); + php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name); } /* }}} */ static zval *incomplete_class_get_property(zval *object, zval *member, int type TSRMLS_DC) { - incomplete_class_message(E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE TSRMLS_CC); if(type == BP_VAR_W || type == BP_VAR_RW) { return EG(error_zval_ptr); } else { @@ -68,28 +62,28 @@ static void incomplete_class_write_property(zval *object, zval *member, zval *value TSRMLS_DC) { - incomplete_class_message(E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE TSRMLS_CC); } static zval **incomplete_class_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) { - incomplete_class_message(E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE TSRMLS_CC); return &EG(error_zval_ptr); } static void incomplete_class_unset_property(zval *object, zval *member TSRMLS_DC) { - incomplete_class_message(E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE TSRMLS_CC); } static int incomplete_class_has_property(zval *object, zval *member, int check_empty TSRMLS_DC) { - incomplete_class_message(E_NOTICE TSRMLS_CC); + incomplete_class_message(object, E_NOTICE TSRMLS_CC); return 0; } static union _zend_function *incomplete_class_get_method(zval *object, char *method, int method_len TSRMLS_DC) { - incomplete_class_message(E_ERROR TSRMLS_CC); + incomplete_class_message(object, E_ERROR TSRMLS_CC); return NULL; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php