From 0976a2646a10384957a848c8815a906c8330a85c Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 5 Feb 2008 19:08:24 +0000 Subject: - MFH Fix cross class tree reference issues with callbacks (colder,helly) --- Zend/zend_API.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Zend/zend_API.c') diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 05ab18d5f5..db63c01b74 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2359,7 +2359,10 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze /* This is a compound name. * Try to fetch class and then find static method. */ - *ce_ptr = zend_fetch_class(Z_STRVAL_P(callable), clen, ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_SILENT TSRMLS_CC); + zend_class_entry *last_scope = EG(scope); + EG(scope) = ce_org; + *ce_ptr = zend_fetch_class(Z_STRVAL_P(callable), clen, ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_SILENT TSRMLS_CC); + EG(scope) = last_scope; if (!*ce_ptr) { char *cname = estrndup(Z_STRVAL_P(callable), clen); if (error) zend_spprintf(error, 0, "class '%s' not found", cname); @@ -2375,7 +2378,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze } else if (ce_org) { /* Try to fetch find static method of given class. */ mlen = Z_STRLEN_P(callable); - lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable)); + lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable)); ftable = &ce_org->function_table; *ce_ptr = ce_org; } else { -- cgit v1.2.1