1
0

Patch HTTP-host cookies and basepath detection, by Rob

This commit is contained in:
Garvin Hicking
2007-05-16 13:29:28 +00:00
parent 78cc09f15f
commit 3a50d73d9c
3 changed files with 9 additions and 8 deletions

@ -272,6 +272,10 @@ if (defined('USE_MEMSNAP')) {
serendipity_load_configuration();
$serendipity['lang'] = serendipity_getSessionLanguage();
if ( (isset($serendipity['autodetect_baseURL']) && serendipity_db_bool($serendipity['autodetect_baseURL'])) ||
(isset($serendipity['embed']) && serendipity_db_bool($serendipity['embed'])) ) {
$serendipity['baseURL'] = 'http' . (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . (!strstr($_SERVER['HTTP_HOST'], ':') && !empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '') . $serendipity['serendipityHTTPPath'];
}
/*
* If a user is logged in, fetch his preferences. He possibly wants to have a different language
*/
@ -354,12 +358,6 @@ $serendipity['permissionLevels'] = array(USERLEVEL_EDITOR => USERLEVEL_EDITOR_DE
USERLEVEL_CHIEF => USERLEVEL_CHIEF_DESC,
USERLEVEL_ADMIN => USERLEVEL_ADMIN_DESC);
if ( (isset($serendipity['autodetect_baseURL']) && serendipity_db_bool($serendipity['autodetect_baseURL'])) ||
(isset($serendipity['embed']) && serendipity_db_bool($serendipity['embed'])) ) {
$serendipity['baseURL'] = 'http' . (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . (!strstr($_SERVER['HTTP_HOST'], ':') && !empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '') . $serendipity['serendipityHTTPPath'];
}
/*
* Check if the installed version is higher than the version of the config
*/