Fix server detection.

This commit is contained in:
Lars Jung 2014-07-05 02:58:15 +02:00
parent 258fcf29c9
commit d33b0156fc

View file

@ -40,9 +40,9 @@ function setup() {
$server_name = null;
$server_version = null;
$server_software = getenv("SERVER_SOFTWARE");
if ($server_software && preg_match("#^(.*?)/(.*?)(?: |$)#", strtolower($server_software), $matches)) {
if ($server_software && preg_match("#^(.*?)(?:/(.*?))?(?: |$)#", strtolower($server_software), $matches)) {
$server_name = $matches[1];
$server_version = $matches[2];
$server_version = count($matches) > 2 ? $matches[2] : '';
}
define("SERVER_NAME", $server_name);
define("SERVER_VERSION", $server_version);