cvs: ZendEngine2(PHP_5_3) / zend_API.c

[email protected] ("Marcus Boerger")
Newsgroups php.zend-engine.cvs
Message-ID <cvshelly1202238505@cvsserver>
helly		Tue Feb  5 19:08:25 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_API.c 
  Log:
  - MFH Fix cross class tree reference issues with callbacks (colder,helly)
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.25&r2=1.296.2.27.2.34.2.26&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.25 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.26
--- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.25	Sat Feb  2 22:29:41 2008
+++ ZendEngine2/zend_API.c	Tue Feb  5 19:08:24 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.296.2.27.2.34.2.25 2008/02/02 22:29:41 tony2001 Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.34.2.26 2008/02/05 19:08:24 helly Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -2359,7 +2359,10 @@
 
 		/* 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 @@
 	} 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 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.