|
@@ -24,7 +24,7 @@ if (!defined('SMF'))
|
|
|
*/
|
|
|
function reloadSettings()
|
|
|
{
|
|
|
- global $modSettings, $boarddir, $smcFunc, $txt, $db_character_set, $sourcedir;
|
|
|
+ global $modSettings, $boarddir, $smcFunc, $txt, $db_character_set, $sourcedir, $context;
|
|
|
|
|
|
// Most database systems have not set UTF-8 as their default input charset.
|
|
|
if (!empty($db_character_set))
|
|
@@ -207,6 +207,20 @@ function reloadSettings()
|
|
|
|
|
|
// Call pre load integration functions.
|
|
|
call_integration_hook('integrate_pre_load');
|
|
|
+
|
|
|
+ // This determines the server... not used in many places, except for login fixing.
|
|
|
+ $context['server'] = array(
|
|
|
+ 'is_iis' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false,
|
|
|
+ 'is_apache' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false,
|
|
|
+ 'is_litespeed' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false,
|
|
|
+ 'is_lighttpd' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false,
|
|
|
+ 'is_nginx' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false,
|
|
|
+ 'is_cgi' => isset($_SERVER['SERVER_SOFTWARE']) && strpos(php_sapi_name(), 'cgi') !== false,
|
|
|
+ 'is_windows' => strpos(PHP_OS, 'WIN') === 0,
|
|
|
+ 'iso_case_folding' => ord(strtolower(chr(138))) === 154,
|
|
|
+ );
|
|
|
+ // A bug in some versions of IIS under CGI (older ones) makes cookie setting not work with Location: headers.
|
|
|
+ $context['server']['needs_login_fix'] = $context['server']['is_cgi'] && $context['server']['is_iis'];
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1666,20 +1680,6 @@ function loadTheme($id_theme = 0, $initialize = true)
|
|
|
// Set some permission related settings.
|
|
|
$context['show_login_bar'] = $user_info['is_guest'] && !empty($modSettings['enableVBStyleLogin']);
|
|
|
|
|
|
- // This determines the server... not used in many places, except for login fixing.
|
|
|
- $context['server'] = array(
|
|
|
- 'is_iis' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false,
|
|
|
- 'is_apache' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false,
|
|
|
- 'is_litespeed' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false,
|
|
|
- 'is_lighttpd' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false,
|
|
|
- 'is_nginx' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false,
|
|
|
- 'is_cgi' => isset($_SERVER['SERVER_SOFTWARE']) && strpos(php_sapi_name(), 'cgi') !== false,
|
|
|
- 'is_windows' => strpos(PHP_OS, 'WIN') === 0,
|
|
|
- 'iso_case_folding' => ord(strtolower(chr(138))) === 154,
|
|
|
- );
|
|
|
- // A bug in some versions of IIS under CGI (older ones) makes cookie setting not work with Location: headers.
|
|
|
- $context['server']['needs_login_fix'] = $context['server']['is_cgi'] && $context['server']['is_iis'];
|
|
|
-
|
|
|
// Detect the browser. This is separated out because it's also used in attachment downloads
|
|
|
detectBrowser();
|
|
|
|