summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c30
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;