Ticket #10186: 10186.patch
File 10186.patch, 1.3 KB (added by , 15 years ago) |
---|
-
vars.php
65 65 * Whether the server software is Apache or something else 66 66 * @global bool $is_apache 67 67 */ 68 $is_apache = ( strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);68 $is_apache = (preg_match('/(?:Apache|LiteSpeed)(?:\/(\d+(?:\.\d+)?))?/', $_SERVER['SERVER_SOFTWARE'], $apache_version) === 1); 69 69 70 70 /** 71 71 * Whether the server software is IIS or something else 72 72 * @global bool $is_IIS 73 73 */ 74 $is_IIS = ( strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);74 $is_IIS = (preg_match('/Microsoft-IIS(?:\/(\d+(?:\.\d+)?))?/', $_SERVER['SERVER_SOFTWARE'], $iis_version) === 1); 75 75 76 76 /** 77 * Server version number 78 * @global float|null $server_version 79 */ 80 81 $server_version = (isset($apache_version[1]) ? (float)$apache_version[1] : (isset($iis_version[1]) ? (float)$iis_version[1] : null)); 82 83 /** 77 84 * Whether the server software is IIS 7.X 78 85 * @global bool $is_iis7 79 86 */ 80 $is_iis7 = ( strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false);87 $is_iis7 = ($is_IIS === true && $server_version >= 7 && $server_version <8); 81 88 82 83 89 ?> 84 No newline at end of file