diff --git a/ChangeLog b/ChangeLog index 41d5561dd..a77dab9d3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ $Source$ * libraries/Config.class.php: - added check is_readable for user config file - check config file also on wakeup (bug #1376522) + * libraries/Config.class.php, libraries/common.lib.php: + fixed handling of https and $cfg['ForceSSL'] (bug #1379491) 2005-12-14 Michal Čihař * libraries/config.default.php, Documentation.html: Transliterate invalid diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 4fe216bef..6af00c8d2 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -66,6 +66,8 @@ class PMA_Config // other settings, independant from config file, comes in $this->checkSystem(); + + $this->checkIsHttps(); } /** @@ -283,6 +285,11 @@ class PMA_Config $this->checkSystem(); } + // check for https needs to be done everytime, + // as https and http uses same session so this info can not be stored + // in session + $this->checkIsHttps(); + $this->checkCollationConnection(); } @@ -653,11 +660,7 @@ class PMA_Config */ function isHttps() { - static $is_https = null; - - if ( null !== $is_https ) { - return $is_https; - } + $is_https = false; $url = array(); diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 884b46051..3808576e3 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2788,6 +2788,20 @@ if (!defined('PMA_MINIMUM_COMMON')) { // BC $_SESSION['PMA_Config']->enableBc(); + +/** + * check https connection + */ +if ($_SESSION['PMA_Config']->get('ForceSSL') + && !$_SESSION['PMA_Config']->get('is_https')) { + PMA_sendHeaderLocation( + preg_replace('/^http/', 'https', + $_SESSION['PMA_Config']->get('PmaAbsoluteUri')) + . PMA_generate_common_url($_GET)); + exit; +} + + /******************************************************************************/ /* loading language file LABEL_loading_language_file */ @@ -2909,18 +2923,6 @@ if (!defined('PMA_MINIMUM_COMMON')) { */ require_once './libraries/string.lib.php'; - /** - * check https connection - */ - if ($_SESSION['PMA_Config']->get('ForceSSL') - && !$_SESSION['PMA_Config']->get('is_https')) { - PMA_sendHeaderLocation( - preg_replace('/^http/', 'https', - $_SESSION['PMA_Config']->get('PmaAbsoluteUri')) - . PMA_generate_common_url($_GET)); - exit; - } - /** * @var array database list */