Fix URI detection in case REQUEST_URI contains full URI (patch #1044123).

This commit is contained in:
Michal Čihař
2004-10-25 13:01:38 +00:00
parent bd5b4bfab9
commit d6b965b4ac
2 changed files with 32 additions and 22 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-10-25 Michal Čihař <michal@cihar.com>
* libraries/common.lib.php: Fix URI detection in case REQUEST_URI contains
full URI (patch #1044123).
2004-10-24 Michael Keck <mkkeck@users.sourceforge.net>
* config.inc.php, themes/*/layout.inc.php:
bug #1050666 - Query window too small darkblue/orange theme

View File

@@ -1009,6 +1009,11 @@ if ($is_minimum_common == FALSE) {
if (isset(${$SERVER_ARRAY}['HTTP_SCHEME'])) {
$HTTP_SCHEME = ${$SERVER_ARRAY}['HTTP_SCHEME'];
}
// in some cases $REQUEST_URI contains full URI including protocol and host, so just use it:
if (isset($REQUEST_URI) && preg_match('@https?://@', $REQUEST_URI)) {
$cfg['PmaAbsoluteUri'] = substr($REQUEST_URI, 0, strrpos($REQUEST_URI, '/') + 1);
} else {
if (!empty($HTTP_SCHEME)) {
$cfg['PmaAbsoluteUri'] = $HTTP_SCHEME . '://';
} else {
@@ -1033,6 +1038,7 @@ if ($is_minimum_common == FALSE) {
} else {
$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.