From 8e2e646eb5e05f44ae6e1126e76ddc007625d60f Mon Sep 17 00:00:00 2001 From: lacatoire Date: Fri, 7 Aug 2026 16:20:50 +0200 Subject: [PATCH] Enforce zero arity in apache_get_version() and apache_get_modules() Both functions are declared with no parameters in the stub, but neither implementation called ZEND_PARSE_PARAMETERS_NONE(), so extra positional arguments were silently accepted instead of raising ArgumentCountError. Every other zero-arity function of the same SAPI (apache_request_headers(), apache_response_headers(), getallheaders()) already enforces its arity, and so does the litespeed implementation of apache_get_modules(). No stub or arginfo change is needed. --- sapi/apache2handler/php_functions.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 1baa1f5225e0..db2dcca72bda 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -308,6 +308,8 @@ static const char *php_apache_get_version(void) /* {{{ Fetch Apache version */ PHP_FUNCTION(apache_get_version) { + ZEND_PARSE_PARAMETERS_NONE(); + const char *apv = php_apache_get_version(); if (apv && *apv) { @@ -324,6 +326,8 @@ PHP_FUNCTION(apache_get_modules) int n; char *p; + ZEND_PARSE_PARAMETERS_NONE(); + array_init(return_value); for (n = 0; ap_loaded_modules[n]; ++n) {