Fix: PHP built-in server detection for PHP 8.3 SERVER_SOFTWARE format

This commit is contained in:
Jan Schuppik 2025-08-14 10:46:39 +02:00 committed by Johannes Meyer
parent 73c813eded
commit ee3f3135b8

View File

@ -18,7 +18,7 @@ if (isset($_SERVER['REQUEST_URI'])) {
// Workaround, PHPs internal Webserver seems to mess up SCRIPT_FILENAME
// as it prefixes it's absolute path with DOCUMENT_ROOT
if (preg_match('/^PHP .* Development Server/', $_SERVER['SERVER_SOFTWARE'])) {
if (preg_match('/^PHP.*Development Server/', $_SERVER['SERVER_SOFTWARE'])) {
$script = basename($_SERVER['SCRIPT_FILENAME']);
$_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = '/' . $script;
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT']