From 1a45c89702ff66694422cffd48b58fc209ff5830 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 27 Jun 2006 14:12:02 +0000 Subject: [PATCH] Recalculate URL only if needed not all times when using https. --- ChangeLog | 2 ++ libraries/Config.class.php | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3406cc2f13..8ca0230561 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,8 @@ $Source$ * scripts/setup.php, libraries/compat/var_export.php: Add var_export compatibility wrapper from PEAR PHP_Compat to make setup.php work on PHP 4.1 (bug #1513007). + * libraries/Config.class.php: Recalculate URL only if needed not all times + when using https. 2006-06-25 Marc Delisle * libraries/export/pdf.php, libraries/plugin_interface.lib.php, lang/*: diff --git a/libraries/Config.class.php b/libraries/Config.class.php index d70b370e66..208a7ce589 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -509,9 +509,13 @@ class PMA_Config // Setup a default value to let the people and lazy syadmins work anyway, // they'll get an error if the autodetect code doesn't work $pma_absolute_uri = $this->get('PmaAbsoluteUri'); - // by recomputing $pma_absolute_uri when is_https, we ensure - // that a user switching from http to https stays in https - if (strlen($pma_absolute_uri) < 1 || $this->get('is_https')) { + $is_https = $this->get('is_https'); + if (strlen($pma_absolute_uri) < 5 + // needed to catch http/https switch + || ($is_https && substr($pma_absolute_uri, 0, 6) != 'https:') + || (!$is_https && substr($pma_absolute_uri, 0, 5) != 'http:') + ) { + echo "recheck"; $url = array(); // At first we try to parse REQUEST_URI, it might contain full URL -- 2.11.4.GIT