diff options
author | Stanislav Malyshev <stas@php.net> | 2012-05-12 22:12:48 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2012-05-14 11:03:21 -0700 |
commit | d03900dc92af6d47921143f226217eae3ca564b7 (patch) | |
tree | cac0b3f05f139afa395f4b8ead1a43a4504f128e /Zend/zend_objects.c | |
parent | 47db8a9aa19f6e17a1018becf9978315c79a1cb0 (diff) | |
download | php-git-d03900dc92af6d47921143f226217eae3ca564b7.tar.gz |
fix bug #61782 - __clone/__destruct do not match other methods when checking access controls
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r-- | Zend/zend_objects.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 7fadcf740b..f7470fa578 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -28,7 +28,7 @@ ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC) { - object->ce = ce; + object->ce = ce; object->properties = NULL; object->properties_table = NULL; object->guards = NULL; @@ -38,7 +38,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC) { if (object->guards) { zend_hash_destroy(object->guards); - FREE_HASHTABLE(object->guards); + FREE_HASHTABLE(object->guards); } if (object->properties) { zend_hash_destroy(object->properties); @@ -74,23 +74,23 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl if (object->ce != EG(scope)) { zend_class_entry *ce = object->ce; - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to private %s::__destruct() from context '%s'%s", - ce->name, - EG(scope) ? EG(scope)->name : "", + zend_error(EG(in_execution) ? E_ERROR : E_WARNING, + "Call to private %s::__destruct() from context '%s'%s", + ce->name, + EG(scope) ? EG(scope)->name : "", EG(in_execution) ? "" : " during shutdown ignored"); return; } } else { /* Ensure that if we're calling a protected function, we're allowed to do so. */ - if (!zend_check_protected(destructor->common.scope, EG(scope))) { + if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) { zend_class_entry *ce = object->ce; - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to protected %s::__destruct() from context '%s'%s", - ce->name, - EG(scope) ? EG(scope)->name : "", + zend_error(EG(in_execution) ? E_ERROR : E_WARNING, + "Call to protected %s::__destruct() from context '%s'%s", + ce->name, + EG(scope) ? EG(scope)->name : "", EG(in_execution) ? "" : " during shutdown ignored"); return; } @@ -139,7 +139,7 @@ ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC) } ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC) -{ +{ zend_object_value retval; *object = emalloc(sizeof(zend_object)); @@ -222,7 +222,7 @@ ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC) zend_object *new_object; zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - /* assume that create isn't overwritten, so when clone depends on the + /* assume that create isn't overwritten, so when clone depends on the * overwritten one then it must itself be overwritten */ old_object = zend_objects_get_address(zobject TSRMLS_CC); new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC); |