Skip to content

Commit 9c6e206

Browse files
committed
Remove NO_ACCESS flag for zend_is_callable()
We may add support for fake_scope if necessary.
1 parent 7309c23 commit 9c6e206

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Zend/zend_API.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,6 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
29562956
}
29572957
}
29582958
if (!(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC) &&
2959-
!(check_flags & IS_CALLABLE_CHECK_NO_ACCESS) &&
29602959
(fcc->calling_scope &&
29612960
((fcc->object && fcc->calling_scope->__call) ||
29622961
(!fcc->object && fcc->calling_scope->__callstatic)))) {
@@ -3024,8 +3023,7 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
30243023
}
30253024
}
30263025
if (retval
3027-
&& !(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC)
3028-
&& !(check_flags & IS_CALLABLE_CHECK_NO_ACCESS)) {
3026+
&& !(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC)) {
30293027
scope = zend_get_executed_scope();
30303028
if (fcc->function_handler->common.scope != scope) {
30313029
if ((fcc->function_handler->common.fn_flags & ZEND_ACC_PRIVATE)

Zend/zend_API.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length);
327327
ZEND_API ZEND_COLD void zend_wrong_param_count(void);
328328

329329
#define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
330-
#define IS_CALLABLE_CHECK_NO_ACCESS (1<<1)
331330
#define IS_CALLABLE_CHECK_SILENT (1<<3)
332331

333332
ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);

ext/filter/callback_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
2222
zval args[1];
2323
int status;
2424

25-
if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
25+
if (!option_array || !zend_is_callable(option_array, 0, NULL)) {
2626
php_error_docref(NULL, E_WARNING, "First argument is expected to be a valid callback");
2727
zval_ptr_dtor(value);
2828
ZVAL_NULL(value);

0 commit comments

Comments
 (0)