]> granicus.if.org Git - php/commitdiff
Remove NO_ACCESS flag for zend_is_callable()
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 6 Mar 2020 15:29:17 +0000 (16:29 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 6 Mar 2020 15:31:03 +0000 (16:31 +0100)
We may add support for fake_scope if necessary.

Zend/zend_API.c
Zend/zend_API.h
ext/filter/callback_filter.c

index 50a1d434dbddbf7bbbef6c63f967ea4627a30fac..dd823d627ce41981d8e45fce8fe4bf8b6f96eb31 100644 (file)
@@ -2956,7 +2956,6 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
                        }
                }
                if (!(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC) &&
-                   !(check_flags & IS_CALLABLE_CHECK_NO_ACCESS) &&
                    (fcc->calling_scope &&
                     ((fcc->object && fcc->calling_scope->__call) ||
                      (!fcc->object && fcc->calling_scope->__callstatic)))) {
@@ -3024,8 +3023,7 @@ get_function_via_handler:
                                }
                        }
                        if (retval
-                        && !(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC)
-                        && !(check_flags & IS_CALLABLE_CHECK_NO_ACCESS)) {
+                        && !(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC)) {
                                scope = zend_get_executed_scope();
                                if (fcc->function_handler->common.scope != scope) {
                                        if ((fcc->function_handler->common.fn_flags & ZEND_ACC_PRIVATE)
index 0e9315916780f3c13749dd1f0a90d5dea8992554..f64f3469517328f01be283cddd85b590e51829db 100644 (file)
@@ -327,7 +327,6 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length);
 ZEND_API ZEND_COLD void zend_wrong_param_count(void);
 
 #define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
-#define IS_CALLABLE_CHECK_NO_ACCESS   (1<<1)
 #define IS_CALLABLE_CHECK_SILENT      (1<<3)
 
 ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);
index d9ad4bdf24fa35ffae29e2c5e756eac095d10a5c..d02a30b7544d579a252fba2759befd96c93498b7 100644 (file)
@@ -22,7 +22,7 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
        zval args[1];
        int status;
 
-       if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
+       if (!option_array || !zend_is_callable(option_array, 0, NULL)) {
                php_error_docref(NULL, E_WARNING, "First argument is expected to be a valid callback");
                zval_ptr_dtor(value);
                ZVAL_NULL(value);