diff --git a/UPGRADING b/UPGRADING index c9067e02884..a3f6a12f3dc 100644 --- a/UPGRADING +++ b/UPGRADING @@ -68,6 +68,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 ======================================== diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index e59037ac2e8..8ea04137d12 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); } diff --git a/sapi/cli/tests/php_cli_server_002.phpt b/sapi/cli/tests/php_cli_server_002.phpt index 2daf6aad731..d2b561b8bb6 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" "