diff options
author | Ondřej Surý <ondrej@sury.org> | 2013-10-27 20:38:12 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2013-10-27 20:38:12 +0100 |
commit | 749e5ad39dbac3f4f62be438367f8cdf90056815 (patch) | |
tree | ad0677df3bf44a6761380686e400ffd878585288 /Zend/zend_API.c | |
parent | 4ed39205864f58ba7c368e4ae1362d8214469fd9 (diff) | |
download | php-749e5ad39dbac3f4f62be438367f8cdf90056815.tar.gz |
New upstream version 5.4.21upstream/5.4.21
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 529092ab9..125a1a256 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1143,7 +1143,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas /* This function requires 'properties' to contain all props declared in the * class and all props being public. If only a subset is given or the class - * has protected members then you need to merge the properties seperately by + * has protected members then you need to merge the properties separately by * calling zend_merge_properties(). */ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */ { @@ -2514,7 +2514,12 @@ ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_c char *lcname = zend_str_tolower_dup(name, name_len); int ret; - ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL); + if (lcname[0] == '\\') { + ret = zend_hash_add(CG(class_table), lcname+1, name_len, &ce, sizeof(zend_class_entry *), NULL); + } else { + ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL); + } + efree(lcname); if (ret == SUCCESS) { ce->refcount++; @@ -2779,8 +2784,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca } if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 && (fcc->calling_scope && - (fcc->calling_scope->__call || - fcc->calling_scope->__callstatic))) { + ((fcc->object_ptr && fcc->calling_scope->__call) || + (!fcc->object_ptr && fcc->calling_scope->__callstatic)))) { if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) { if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) { retval = 0; @@ -3917,15 +3922,16 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name { zend_trait_alias *alias, **alias_ptr; - alias_ptr = ce->trait_aliases; - alias = *alias_ptr; - while (alias) { - if (alias->alias_len == len && - !strncasecmp(name, alias->alias, alias->alias_len)) { - return alias->alias; - } - alias_ptr++; + if ((alias_ptr = ce->trait_aliases)) { alias = *alias_ptr; + while (alias) { + if (alias->alias_len == len && + !strncasecmp(name, alias->alias, alias->alias_len)) { + return alias->alias; + } + alias_ptr++; + alias = *alias_ptr; + } } return name; |