diff --git a/ChangeLog b/ChangeLog index 3e8d869dc..2ce78fe94 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,13 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-02-24 Olivier L. Müller + * libraries/common.lib.php3: if $cfg['PmaAbsoluteUri'] is empty and + port == 80 or port == 443, do not add ":80" or ":443" anymore to the + generated URL -> prevents a double password query with some browsers + (Safari) in case of http authentication. (tested with https, http and + http running on port 8080) + 2003-02-24 Michal Cihar * tbl_change.php3, tbl_replace_fields.php3: Move magic words used for fields type into special variable. Fixes #647689. diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 45c337648..3a261fd65 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -523,9 +523,17 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} if (empty($cfg['PmaAbsoluteUri'])) { $port_in_HTTP_HOST = (strpos($HTTP_SERVER_VARS['HTTP_HOST'], ':') > 0); $cfg['PmaAbsoluteUri'] = ((!empty($HTTP_SERVER_VARS['HTTPS']) && strtolower($HTTP_SERVER_VARS['HTTPS']) != 'off') ? 'https' : 'http') . '://' - . $HTTP_SERVER_VARS['HTTP_HOST'] - . ((!empty($HTTP_SERVER_VARS['SERVER_PORT']) && !$port_in_HTTP_HOST) ? ':' . $HTTP_SERVER_VARS['SERVER_PORT'] : '') - . substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1); + . $HTTP_SERVER_VARS['HTTP_HOST']; + + // if $cfg['PmaAbsoluteUri'] is empty and port == 80 or port == 443, do not add ":80" or ":443" + // to the generated URL -> prevents a double password query in case of http authentication. + + if (!(!$port_in_HTTP_HOST && !empty($HTTP_SERVER_VARS['SERVER_PORT']) && ($HTTP_SERVER_VARS['SERVER_PORT'] == 80 || $HTTP_SERVER_VARS['SERVER_PORT'] == 443))) { + $cfg['PmaAbsoluteUri'] .= ((!empty($HTTP_SERVER_VARS['SERVER_PORT']) && !$port_in_HTTP_HOST) ? ':' . $HTTP_SERVER_VARS['SERVER_PORT'] : ''); + } + + $cfg['PmaAbsoluteUri'] .= substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1); + // We display the warning by default, but not if it is disabled thru // via the $cfg['PmaAbsoluteUri_DisableWarning'] variable. // This is intended for sysadmins that actually want the default