PHP3 compatibility

This commit is contained in:
Alexander M. Turek
2003-03-03 12:03:05 +00:00
parent ed6aca1751
commit 971c256a9f
2 changed files with 24 additions and 6 deletions

View File

@@ -8,7 +8,9 @@ $Source$
2003-03-03 Alexander M. Turek <rabus@users.sourceforge.net> 2003-03-03 Alexander M. Turek <rabus@users.sourceforge.net>
* tbl_replace_fields.php3: Bugfix: User was unable to insert values * tbl_replace_fields.php3: Bugfix: User was unable to insert values
containing quotes. containing quotes.
* libraries/common.lib.php3: Avoid reloading the left frame twice. * libraries/common.lib.php3:
- Avoid reloading the left frame twice;
- PHP3 compatibility.
2003-03-03 Marc Delisle <lem9@users.sourceforge.net> 2003-03-03 Marc Delisle <lem9@users.sourceforge.net>
* badwords.txt: bug 692874: "date" is not a reserved word * badwords.txt: bug 692874: "date" is not a reserved word

View File

@@ -541,15 +541,31 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// work anyway, but display a big warning on the main.php3 // work anyway, but display a big warning on the main.php3
// page. // page.
if (empty($cfg['PmaAbsoluteUri'])) { if (empty($cfg['PmaAbsoluteUri'])) {
$port_in_HTTP_HOST = (strpos($HTTP_SERVER_VARS['HTTP_HOST'], ':') > 0); if (!empty($_SERVER)) {
$cfg['PmaAbsoluteUri'] = ((!empty($HTTP_SERVER_VARS['HTTPS']) && strtolower($HTTP_SERVER_VARS['HTTPS']) != 'off') ? 'https' : 'http') . '://' $SERVER_ARRAY = '_SERVER';
. $HTTP_SERVER_VARS['HTTP_HOST']; } else if (!empty($HTTP_SERVER_VARS)) {
$SERVER_ARRAY = 'HTTP_SERVER_VARS';
} else {
$SERVER_ARRAY = 'GLOBALS';
} // end if
if (isset($$SERVER_ARRAY['HTTP_HOST'])) {
$HTTP_HOST = $$SERVER_ARRAY['HTTP_HOST'];
}
if (isset($$SERVER_ARRAY['HTTPS'])) {
$HTTPS = $$SERVER_ARRAY['HTTPS'];
}
if (isset($$SERVER_ARRAY['SERVER_PORT'])) {
$SERVER_PORT = $$SERVER_ARRAY['SERVER_PORT'];
}
$port_in_HTTP_HOST = (strpos($HTTP_HOST, ':') > 0);
$cfg['PmaAbsoluteUri'] = ((!empty($HTTPS) && strtolower($HTTPS) != 'off') ? 'https' : 'http') . '://'
. $HTTP_HOST;
// if $cfg['PmaAbsoluteUri'] is empty and port == 80 or port == 443, do not add ":80" or ":443" // 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. // 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))) { if (!(!$port_in_HTTP_HOST && !empty($SERVER_PORT) && ($SERVER_PORT == 80 || $SERVER_PORT == 443))) {
$cfg['PmaAbsoluteUri'] .= ((!empty($HTTP_SERVER_VARS['SERVER_PORT']) && !$port_in_HTTP_HOST) ? ':' . $HTTP_SERVER_VARS['SERVER_PORT'] : ''); $cfg['PmaAbsoluteUri'] .= ((!empty($SERVER_PORT) && !$port_in_HTTP_HOST) ? ':' . $SERVER_PORT : '');
} }
$cfg['PmaAbsoluteUri'] .= substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1); $cfg['PmaAbsoluteUri'] .= substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1);