]> granicus.if.org Git - php/commitdiff
- zend_(u_)_unmangle_property_name() has changed
authorMarcus Boerger <helly@php.net>
Mon, 24 Jul 2006 17:55:41 +0000 (17:55 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 24 Jul 2006 17:55:41 +0000 (17:55 +0000)
ext/reflection/php_reflection.c
ext/soap/php_encoding.c
ext/standard/http.c
ext/standard/var.c
ext/wddx/wddx.c

index afccde7234eabf3026e7f37e1abeeece7fac9d8b..7118bfbec86f20c5dc46226ce1d1809197b07e4e 100644 (file)
@@ -791,7 +791,7 @@ static void _property_string(string *str, zend_property_info *prop, char *sz_pro
                        string_printf(str, "static ");
                }
 
-               zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, &class_name, &prop_name);
+               zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, prop->name_length, &class_name, &prop_name);
                string_printf(str, "$%v", prop_name);
        }
 
@@ -1115,7 +1115,7 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
        zstr class_name, prop_name;
        zend_uchar utype = UG(unicode) ? IS_UNICODE : IS_STRING;
 
-       zend_u_unmangle_property_name(utype, prop->name, &class_name, &prop_name);
+       zend_u_unmangle_property_name(utype, prop->name, prop->name_length, &class_name, &prop_name);
        
        if (!(prop->flags & ZEND_ACC_PRIVATE)) {
                /* we have to seach the class hierarchy for this (implicit) public or protected property */
@@ -2755,7 +2755,7 @@ ZEND_METHOD(reflection_class, getDefaultProperties)
 
                        zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &num_index, 0, &pos);
                        zend_hash_move_forward_ex(&ce->default_properties, &pos);
-                       zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, key, &class_name, &prop_name);
+                       zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, key, key_len-1, &class_name, &prop_name);
                        /* FIXME: Unicode support??? */
                        if (class_name.s && class_name.s[0] != '*' && strcmp(class_name.s, ce->name.s)) {
                                /* filter privates from base classes */
@@ -3770,7 +3770,7 @@ ZEND_METHOD(reflection_property, __construct)
        ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
        zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
        
-       zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, &class_name, &prop_name);
+       zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, property_info->name_length, &class_name, &prop_name);
        MAKE_STD_ZVAL(propname);
        ZVAL_TEXT(propname, prop_name, 1);
        zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL);
index 2695ec6c43f32da1911731bdc2be327b27a13776..ad3a3c1f35ecc9a1145f000dac5cef9c6901948a 100644 (file)
@@ -1844,7 +1844,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
                                        if (Z_TYPE_P(data) == IS_OBJECT) {
                                                char *class_name;
 
-                                               zend_unmangle_property_name(key.s, &class_name, &prop_name);
+                                               zend_unmangle_property_name(key.s, key_len-1, &class_name, &prop_name);
                                        } else {
                                                prop_name = key.s;
                                        }
index fe37e4c075edece56d128f376b54f77bc611e747..76a6f08fc03bb17f358aeb0f184207af8f579d33 100644 (file)
@@ -71,11 +71,11 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
                        zstr tmp;
 
                        zend_object *zobj = zend_objects_get_address(type TSRMLS_CC);
-                       if (zend_check_property_access(zobj, IS_STRING, key TSRMLS_CC) != SUCCESS) {
+                       if (zend_check_property_access(zobj, IS_STRING, key, key_len TSRMLS_CC) != SUCCESS) {
                                /* private or protected property access outside of the class */
                                continue;
                        }
-                       zend_u_unmangle_property_name(key_type, key, &tmp, &key);
+                       zend_u_unmangle_property_name(key_type, key, key_len, &tmp, &key);
                        key_len = strlen(key.s);                
                }
 
index 52c8878caea9fb5e1d710daacf0ef952bf7fb1c5..34d80516a7ad4055d7babc79b9da94e431bcf687 100644 (file)
@@ -149,7 +149,7 @@ static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_
        } else { /* string key */
                int is_unicode = hash_key->type == IS_UNICODE;
 
-               zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, &class_name, &prop_name);
+               zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
                php_printf("%*c[", level + 1, ' ');
 
                if (class_name.s) {
@@ -345,7 +345,7 @@ static int zval_object_property_dump(zval **zv, int num_args, va_list args, zend
        } else { /* string key */
                int is_unicode = hash_key->type == IS_UNICODE;
 
-               zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, &class_name, &prop_name);
+               zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
                php_printf("%*c[", level + 1, ' ');
 
                if (class_name.s) {
@@ -506,7 +506,7 @@ static int php_object_element_export(zval **zv, int num_args, va_list args, zend
 
        if (hash_key->nKeyLength != 0) {
                php_printf("%*c", level + 1, ' ');
-               zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, &class_name, &prop_name);
+               zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
                php_printf(" '%R' => ", hash_key->type, prop_name);
                php_var_export(zv, level + 2 TSRMLS_CC);
                PUTS (",\n");
index 3baf57a8915c08110f35ad05f3748b2949baaa87..f1dd4ff0ed3af90669b9467d642e9e590f7bda74 100644 (file)
@@ -530,7 +530,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
                        if (zend_hash_get_current_key_ex(HASH_OF(obj), &key, &key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) {
                                char *class_name, *prop_name;
                                
-                               zend_unmangle_property_name(key, &class_name, &prop_name);
+                               zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
                                php_wddx_serialize_var(packet, *ent, prop_name, strlen(prop_name)+1 TSRMLS_CC);
                        } else {
                                key_len = sprintf(tmp_buf, "%ld", idx);