fix warning with undefined cfgPmaAbsoluteUri

This commit is contained in:
Steve Alberty
2002-03-14 14:07:33 +00:00
parent 2405524653
commit f080b71dae
2 changed files with 15 additions and 2 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2002-03-14 Steve Alberty <alberty@neptunelabs.de>
* main.php3: fix warning with undefined $cfgPmaAbsoluteUri
2002-03-14 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php3, PMA_MYSQL_INT_VERSION is not yet defined
before the connection

View File

@@ -10,8 +10,18 @@ require('./libraries/common.lib.php3');
// Puts the language to use in a cookie that will expire in 30 days
if (!isset($pma_uri_parts)) {
$pma_uri_parts = parse_url($cfgPmaAbsoluteUri);
$cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
$is_https = ($pma_uri_parts['scheme'] == 'https') ? 1 : 0;
if (isset($pma_uri_parts['path'])) {
$cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
}
else {
$cookie_path = '';
}
if (isset($pma_uri_parts['scheme'])) {
$is_https = ($pma_uri_parts['scheme'] == 'https') ? 1 : 0;
}
else {
$is_https = 0;
}
}
setcookie('lang', $lang, time() + 60*60*24*30, $cookie_path, '', $is_https);
// Defines the "item" image depending on text direction