Skip to content

Commit b897d19

Browse files
committed
Add missing zend_parse_parameters_none()
We fix the trivial cases; some others need further discussion, see <https://news-web.php.net/php.internals/107723>.
1 parent 87fefd1 commit b897d19

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

ext/reflection/php_reflection.c

+33
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,11 @@ ZEND_METHOD(reflection_function, isDisabled)
16491649
zend_function *fptr;
16501650

16511651
GET_REFLECTION_OBJECT_PTR(fptr);
1652+
1653+
if (zend_parse_parameters_none() == FAILURE) {
1654+
return;
1655+
}
1656+
16521657
RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION && fptr->internal_function.handler == zif_display_disabled_function);
16531658
}
16541659
/* }}} */
@@ -1890,6 +1895,10 @@ ZEND_METHOD(reflection_function, returnsReference)
18901895

18911896
GET_REFLECTION_OBJECT_PTR(fptr);
18921897

1898+
if (zend_parse_parameters_none() == FAILURE) {
1899+
return;
1900+
}
1901+
18931902
RETURN_BOOL((fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0);
18941903
}
18951904
/* }}} */
@@ -1904,6 +1913,10 @@ ZEND_METHOD(reflection_function, getNumberOfParameters)
19041913

19051914
GET_REFLECTION_OBJECT_PTR(fptr);
19061915

1916+
if (zend_parse_parameters_none() == FAILURE) {
1917+
return;
1918+
}
1919+
19071920
num_args = fptr->common.num_args;
19081921
if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) {
19091922
num_args++;
@@ -1922,6 +1935,10 @@ ZEND_METHOD(reflection_function, getNumberOfRequiredParameters)
19221935

19231936
GET_REFLECTION_OBJECT_PTR(fptr);
19241937

1938+
if (zend_parse_parameters_none() == FAILURE) {
1939+
return;
1940+
}
1941+
19251942
RETURN_LONG(fptr->common.required_num_args);
19261943
}
19271944
/* }}} */
@@ -1937,6 +1954,10 @@ ZEND_METHOD(reflection_function, getParameters)
19371954

19381955
GET_REFLECTION_OBJECT_PTR(fptr);
19391956

1957+
if (zend_parse_parameters_none() == FAILURE) {
1958+
return;
1959+
}
1960+
19401961
arg_info= fptr->common.arg_info;
19411962
num_args = fptr->common.num_args;
19421963
if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) {
@@ -1976,6 +1997,10 @@ ZEND_METHOD(reflection_function, getExtension)
19761997

19771998
GET_REFLECTION_OBJECT_PTR(fptr);
19781999

2000+
if (zend_parse_parameters_none() == FAILURE) {
2001+
return;
2002+
}
2003+
19792004
if (fptr->type != ZEND_INTERNAL_FUNCTION) {
19802005
RETURN_NULL();
19812006
}
@@ -1999,6 +2024,10 @@ ZEND_METHOD(reflection_function, getExtensionName)
19992024

20002025
GET_REFLECTION_OBJECT_PTR(fptr);
20012026

2027+
if (zend_parse_parameters_none() == FAILURE) {
2028+
return;
2029+
}
2030+
20022031
if (fptr->type != ZEND_INTERNAL_FUNCTION) {
20032032
RETURN_FALSE;
20042033
}
@@ -4643,6 +4672,10 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
46434672

46444673
GET_REFLECTION_OBJECT_PTR(ce);
46454674

4675+
if (zend_parse_parameters_none() == FAILURE) {
4676+
return;
4677+
}
4678+
46464679
if (ce->type == ZEND_INTERNAL_CLASS
46474680
&& ce->create_object != NULL && (ce->ce_flags & ZEND_ACC_FINAL)) {
46484681
zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ZSTR_VAL(ce->name));

0 commit comments

Comments
 (0)