Commit: be07f815f240803fe7a48a5fb3d68a169bef4707 Author: Xinchen Hui <larue...@php.net> Mon, 14 Jan 2013 17:08:21 +0800 Parents: 62059c16ee2f2802caa00f2aad2fa44c867dd1f1 Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=be07f815f240803fe7a48a5fb3d68a169bef4707 Log: Use zend_unmangle_property_name_ex to save strlen Changed paths: M Zend/zend_compile.c M Zend/zend_object_handlers.c M ext/standard/http.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a5d6add..43b8916 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4221,9 +4221,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { prop_name_length = property_info->name_length; } else { /* for private and protected we need to unmangle the names */ - zend_unmangle_property_name(property_info->name, property_info->name_length, - &class_name_unused, &prop_name); - prop_name_length = strlen(prop_name); + zend_unmangle_property_name_ex(property_info->name, property_info->name_length, + &class_name_unused, &prop_name, &prop_name_length); prop_hash = zend_get_hash_value(prop_name, prop_name_length + 1); } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 2c2a45d..20d4e12 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -363,9 +363,10 @@ ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info zend_property_info *property_info; const char *class_name, *prop_name; zval member; + int prop_name_len; - zend_unmangle_property_name(prop_info_name, prop_info_name_len, &class_name, &prop_name); - ZVAL_STRING(&member, prop_name, 0); + zend_unmangle_property_name_ex(prop_info_name, prop_info_name_len, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(&member, prop_name, prop_name_len, 0); property_info = zend_get_property_info_quick(zobj->ce, &member, 1, NULL TSRMLS_CC); if (!property_info) { return FAILURE; diff --git a/ext/standard/http.c b/ext/standard/http.c index 3e50735..547df52 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -69,12 +69,11 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *tmp; zend_object *zobj = zend_objects_get_address(type TSRMLS_CC); - if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) != SUCCESS) { + if (zend_check_property_access(zobj, key, key_len TSRMLS_CC) != SUCCESS) { /* private or protected property access outside of the class */ continue; } - zend_unmangle_property_name(key, key_len-1, &tmp, (const char**)&key); - key_len = strlen(key); + zend_unmangle_property_name_ex(key, key_len, &tmp, (const char**)&key, &key_len); } if (zend_hash_get_current_data_ex(ht, (void **)&zdata, NULL) == FAILURE || !zdata || !(*zdata)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php