Merge branch 'PHP-5.4' into PHP-5.5

Conflicts:
	Zend/zend_API.c
This commit is contained in:
Xinchen Hui 2013-06-24 23:49:30 +08:00
commit a6a3aa5d49
3 changed files with 31 additions and 3 deletions

3
NEWS
View File

@ -5,7 +5,8 @@ PHP NEWS
- Core:
. Fixed bug #65088 (Generated configure script is malformed on OpenBSD).
(Adam)
. Fixed bug #65108 (is_callable() triggers Fatal Error). (David Soria Parra)
. Fixed bug #65108 (is_callable() triggers Fatal Error).
(David Soria Parra, Laruence)
OPcache
. OPcache must be compatible with LiteSpeed SAPI (Dmitry)

27
Zend/tests/bug65108.phpt Normal file
View File

@ -0,0 +1,27 @@
--TEST--
Bug #65108 (is_callable() triggers Fatal Error)
--FILE--
<?php
class C {
private function f() {}
static function __callStatic($name, $args) {}
}
class B {
public function B() {
$isCallable = is_callable(array(new C, 'f'));
var_dump($isCallable);
}
}
new B();
Class E {
private function f() {}
function __call($name, $args) {}
}
$isCallable = is_callable(array('E', 'f'));
var_dump($isCallable);
--EXPECT--
bool(false)
bool(false)

View File

@ -2842,8 +2842,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->object_ptr) ||
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;