Skip to content

Commit c02348c

Browse files
authored
Make SERVER_SOFTWARE compliant with RFC3875 (#11093)
1 parent 2e0f75e commit c02348c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

UPGRADING

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ PHP 8.3 UPGRADE NOTES
6868
3. Changes in SAPI modules
6969
========================================
7070

71+
- $_SERVER['SERVER_SOFTWARE'] value from the built-in CLI server changed
72+
to make it compliant with RFC3875.
73+
7174
========================================
7275
4. Deprecated Functionality
7376
========================================

sapi/cli/php_cli_server.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ static void sapi_cli_server_register_variables(zval *track_vars_array) /* {{{ */
696696
}
697697
}
698698
{
699-
zend_string *tmp = strpprintf(0, "PHP %s Development Server", PHP_VERSION);
699+
zend_string *tmp = strpprintf(0, "PHP/%s (Development Server)", PHP_VERSION);
700700
sapi_cli_server_register_known_var_str(track_vars_array, "SERVER_SOFTWARE", strlen("SERVER_SOFTWARE"), tmp);
701701
zend_string_release_ex(tmp, /* persistent */ false);
702702
}

sapi/cli/tests/php_cli_server_002.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS));
1414
?>
1515
--EXPECTF--
1616
string(%d) "string(%d) "%sphp_cli_server_002"
17-
string(%d) "PHP %s Development Server"
17+
string(%d) "PHP/%s (Development Server)"
1818
string(%d) "localhost"
1919
string(%d) "%s"
2020
"

0 commit comments

Comments
 (0)