summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-09-05 17:37:57 +0000
committerMarcus Boerger <helly@php.net>2004-09-05 17:37:57 +0000
commit338e3357aebc8f65b275350ae618e6bc7c396206 (patch)
treeae7b891b49b56149fbd33cfe3d05e09b48414c8a
parentefea880e6f268db67876090302698cf8267292e6 (diff)
downloadphp-git-338e3357aebc8f65b275350ae618e6bc7c396206.tar.gz
- Bugfix #29985
-rw-r--r--ext/standard/incomplete_class.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index 911491c951..7f45cd88f3 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -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 zval *incomplete_class_get_property(zval *object, zval *member, int type
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;
}