From d2bd4ee49232a8d8fe1a194d8687c7836de8ea0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Mon, 17 Apr 2023 15:12:48 +0200 Subject: [PATCH 1/3] Make SERVER_SOFTWARE compliant with RFC3875 --- sapi/cli/php_cli_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index e59037ac2e8d3..8ea04137d1229 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -696,7 +696,7 @@ static void sapi_cli_server_register_variables(zval *track_vars_array) /* {{{ */ } } { - zend_string *tmp = strpprintf(0, "PHP %s Development Server", PHP_VERSION); + zend_string *tmp = strpprintf(0, "PHP/%s (Development Server)", PHP_VERSION); sapi_cli_server_register_known_var_str(track_vars_array, "SERVER_SOFTWARE", strlen("SERVER_SOFTWARE"), tmp); zend_string_release_ex(tmp, /* persistent */ false); } From 1aa636e349ae0e392ef84146e2bda987d2b1920e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Mon, 17 Apr 2023 16:29:14 +0200 Subject: [PATCH 2/3] Update tests --- sapi/cli/tests/php_cli_server_002.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/cli/tests/php_cli_server_002.phpt b/sapi/cli/tests/php_cli_server_002.phpt index 2daf6aad73107..d2b561b8bb6bc 100644 --- a/sapi/cli/tests/php_cli_server_002.phpt +++ b/sapi/cli/tests/php_cli_server_002.phpt @@ -14,7 +14,7 @@ var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS)); ?> --EXPECTF-- string(%d) "string(%d) "%sphp_cli_server_002" -string(%d) "PHP %s Development Server" +string(%d) "PHP/%s (Development Server)" string(%d) "localhost" string(%d) "%s" " From 52f2607cf537ea3bda8c53322c19952e3ab31075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Mon, 17 Apr 2023 22:34:53 +0200 Subject: [PATCH 3/3] [ci skip] UPGRADING --- UPGRADING | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UPGRADING b/UPGRADING index a22bc46328e90..f61c352c21b39 100644 --- a/UPGRADING +++ b/UPGRADING @@ -66,6 +66,9 @@ PHP 8.3 UPGRADE NOTES 3. Changes in SAPI modules ======================================== +- $_SERVER['SERVER_SOFTWARE'] value from the built-in CLI server changed + to make it compliant with RFC3875. + ======================================== 4. Deprecated Functionality ========================================