cvs: ZendEngine2(PHP_5_3) / zend_API.c /tests bug45744.phpt

"Dmitry Stogov" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsdmitry1218110654@cvsserver>
dmitry		Thu Aug  7 12:04:14 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /ZendEngine2/tests	bug45744.phpt 

  Modified files:              
    /ZendEngine2	zend_API.c 
  Log:
  Fixed bug #45744 (Case sensitive callback behaviour)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.46&r2=1.296.2.27.2.34.2.47&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.46 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.47
--- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.46	Sat Aug  2 04:46:05 2008
+++ ZendEngine2/zend_API.c	Thu Aug  7 12:04:13 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.296.2.27.2.34.2.46 2008/08/02 04:46:05 felipe Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.34.2.47 2008/08/07 12:04:13 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -2472,7 +2472,6 @@
 		retval = fcc->function_handler ? 1 : 0;
 		call_via_handler = 1;
 	}
-	efree(lmname);
 
 	if (retval) {
 		if (fcc->calling_scope && !call_via_handler) {
@@ -2507,7 +2506,7 @@
 			}
 			if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) {
 				if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
-					if (!zend_check_private(fcc->function_handler, fcc->object_pp ? Z_OBJCE_PP(fcc->object_pp) : EG(scope), mname, mlen TSRMLS_CC)) {
+					if (!zend_check_private(fcc->function_handler, fcc->object_pp ? Z_OBJCE_PP(fcc->object_pp) : EG(scope), lmname, mlen TSRMLS_CC)) {
 						if (error) {
 							if (*error) {
 								efree(*error);
@@ -2536,6 +2535,8 @@
 			if (error) zend_spprintf(error, 0, "function '%s' does not exist", mname);
 		}
 	}
+	efree(lmname);
+
 	if (fcc->object_pp) {
 		fcc->called_scope = Z_OBJCE_PP(fcc->object_pp);
 	}

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug45744.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug45744.phpt
+++ ZendEngine2/tests/bug45744.phpt
--TEST--
Bug #45744 (Case sensitive callback behaviour)
--FILE--
<?php
class Foo {
    public function __construct(array $data) {
		var_dump(array_map(array($this, 'callback'), $data));
    }
    
    private function callback($value) {
        if (!is_array($value)) {
            return stripslashes($value);
        }
	return array_map(array($this, 'callback'), $value);
    }
}

class Bar extends Foo {
}

new Bar(array());

class Foo2 {
    public function __construct(array $data) {
		var_dump(array_map(array($this, 'callBack'), $data));
    }
    
    private function callBack($value) {
    }
}

class Bar2 extends Foo2 {
}

new Bar2(array());
--EXPECT--
array(0) {
}
array(0) {
}



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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.