Skip to content

Commit f81f874

Browse files
committed
zend_std_get_static_method() should return NULL in case of exception thrown from user error handler
1 parent 51f8067 commit f81f874

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Zend/zend_object_handlers.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
14101410
fbc = get_static_method_fallback(ce, function_name);
14111411
}
14121412

1413+
if (UNEXPECTED(!key)) {
1414+
zend_string_release_ex(lc_function_name, 0);
1415+
}
1416+
14131417
if (EXPECTED(fbc)) {
14141418
if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_ABSTRACT)) {
14151419
zend_abstract_method_call(fbc);
@@ -1419,13 +1423,12 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
14191423
"Calling static trait method %s::%s is deprecated, "
14201424
"it should only be called on a class using the trait",
14211425
ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
1426+
if (EG(exception)) {
1427+
return NULL;
1428+
}
14221429
}
14231430
}
14241431

1425-
if (UNEXPECTED(!key)) {
1426-
zend_string_release_ex(lc_function_name, 0);
1427-
}
1428-
14291432
return fbc;
14301433
}
14311434
/* }}} */

0 commit comments

Comments
 (0)