- Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes)
- Fixed bug #37862 (Integer pointer comparison to numeric value).
(bugs-php at thewrittenword dot com)
+- Fixed bug #37816 (ReflectionProperty does not throw exception when accessing
+ protected attribute). (Marcus)
- Fixed bug #37811 (define not using toString on objects). (Marcus)
- Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony)
- Fixed bug #37806 (weird behavior of object type and comparison). (Marcus)
{
reflection_object *intern;
property_reference *ref;
- zval *object;
+ zval *object, name;
zval **member= NULL;
METHOD_NOTSTATIC(reflection_property_ptr);
GET_REFLECTION_OBJECT_PTR(ref);
-#if MBO_0
if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) {
- _DO_THROW("Cannot access non-public member");
- /* Returns from this function */
+ _default_get_entry(getThis(), "name", sizeof("name"), &name TSRMLS_CC);
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ "Cannot access non-public member %s::%s", intern->ce->name, Z_STRVAL(name));
+ zval_dtor(&name);
+ return;
}
-#endif
if ((ref->prop->flags & ZEND_ACC_STATIC)) {
zend_update_class_constants(intern->ce TSRMLS_CC);
if (zend_hash_quick_find(CE_STATIC_MEMBERS(intern->ce), ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) {
- zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name);
+ zend_error(E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop->name);
/* Bails out */
}
} else {
return;
}
if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) {
- zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name);
+ zend_error(E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop->name);
/* Bails out */
}
}
reflection_object *intern;
property_reference *ref;
zval **variable_ptr;
- zval *object;
+ zval *object, name;
zval *value;
int setter_done = 0;
zval *tmp;
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) {
- _DO_THROW("Cannot access non-public member");
- /* Returns from this function */
+ _default_get_entry(getThis(), "name", sizeof("name"), &name TSRMLS_CC);
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ "Cannot access non-public member %s::%s", intern->ce->name, Z_STRVAL(name));
+ zval_dtor(&name);
+ return;
}
if ((ref->prop->flags & ZEND_ACC_STATIC)) {
}
if (zend_hash_quick_find(prop_table, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &variable_ptr) == FAILURE) {
- zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name);
+ zend_error(E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop->name);
/* Bails out */
}
if (*variable_ptr == value) {