From: Michael Wallner Date: Fri, 11 Jul 2008 16:45:11 +0000 (+0000) Subject: fix bug #14218 Class' extending HttpMessage properties not accessible X-Git-Tag: RELEASE_1_6_1~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=cb6f9b9beed92bc0f502f1747bebac24ea42c3db;p=m6w6%2Fext-http fix bug #14218 Class' extending HttpMessage properties not accessible --- diff --git a/http_message_object.c b/http_message_object.c index acb8a1d..b6b3aaf 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -418,7 +418,7 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type #else zend_property_info *pinfo = zend_get_property_info(obj->zo.ce, member, 1 TSRMLS_CC); - if (!pinfo || ACC_PROP_PUBLIC(pinfo->flags)) { + if (!pinfo) { return zend_get_std_object_handlers()->read_property(object, member, type TSRMLS_CC); } #endif @@ -511,11 +511,8 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type break; default: -#ifdef WONKY + FREE_ZVAL(return_value); return zend_get_std_object_handlers()->read_property(object, member, type TSRMLS_CC); -#else - RETVAL_NULL(); -#endif } return return_value; @@ -531,7 +528,7 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va #else zend_property_info *pinfo = zend_get_property_info(obj->zo.ce, member, 1 TSRMLS_CC); - if (!pinfo || ACC_PROP_PUBLIC(pinfo->flags)) { + if (!pinfo) { zend_get_std_object_handlers()->write_property(object, member, value TSRMLS_CC); return; } @@ -617,9 +614,7 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va break; default: -#ifdef WONKY zend_get_std_object_handlers()->write_property(object, member, value TSRMLS_CC); -#endif break; } if (cpy != value) { diff --git a/tests/HttpMessage_002.phpt b/tests/HttpMessage_002.phpt index 4e1f10c..a7ad345 100644 --- a/tests/HttpMessage_002.phpt +++ b/tests/HttpMessage_002.phpt @@ -10,8 +10,29 @@ checkcls('HttpMessage'); var_property); + var_dump($this->public_property); + var_dump($this->protected_property); + var_dump($this->private_property); + var_dump($this->non_ex_property); + $this->var_property.='_property'; + $this->public_property.='_property'; + $this->protected_property.='_property'; + $this->private_property.='_property'; + $this->non_ex_property = 'non_ex'; + var_dump($this->var_property); + var_dump($this->public_property); + var_dump($this->protected_property); + var_dump($this->private_property); + var_dump($this->non_ex_property); + print_r($this->headers); $this->headers['Foo'] = 'Bar'; } @@ -26,7 +47,19 @@ echo "Done\n"; ?> --EXPECTF-- %aTEST +string(3) "var" +string(6) "public" +string(9) "protected" +string(7) "private" + +Notice: Undefined property: Message::$non_ex_property in %s +NULL +string(12) "var_property" +string(15) "public_property" +string(18) "protected_property" +string(16) "private_property" +string(6) "non_ex" Array ( ) -%aFatal error%aCannot access HttpMessage properties by reference or array key/index in%a +%aFatal error%sCannot access HttpMessage properties by reference or array key/index in%s