From 0ea4013f101d64fbeb9221260b36e98f10ed1ddd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 4 Jul 2018 08:48:38 +0200 Subject: Fixed bug #62596 add getallheaders (apache_request_headers) missing function in FPM add sapi_add_request_header in public API (was add_request_header) fix arginfo for fastcgi_finish_request fucntion --- sapi/fpm/fpm/fpm_main.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'sapi/fpm/fpm') diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 3256660264..e815be4700 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1531,6 +1531,10 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */ { fcgi_request *request = (fcgi_request*) SG(server_context); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (!fcgi_is_closed(request)) { php_output_end_all(); php_header(); @@ -1545,8 +1549,27 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */ } /* }}} */ +ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0) +ZEND_END_ARG_INFO() + +PHP_FUNCTION(apache_request_headers) /* {{{ */ +{ + fcgi_request *request; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + array_init(return_value); + if ((request = (fcgi_request*) SG(server_context))) { + fcgi_loadenv(request, sapi_add_request_header, return_value); + } +} /* }}} */ + static const zend_function_entry cgi_fcgi_sapi_functions[] = { - PHP_FE(fastcgi_finish_request, NULL) + PHP_FE(fastcgi_finish_request, cgi_fcgi_sapi_no_arginfo) + PHP_FE(apache_request_headers, cgi_fcgi_sapi_no_arginfo) + PHP_FALIAS(getallheaders, apache_request_headers, cgi_fcgi_sapi_no_arginfo) PHP_FE_END }; -- cgit v1.2.1