From f080b71dae0c4b09d9154b363d5d5a8598ed8434 Mon Sep 17 00:00:00 2001 From: Steve Alberty Date: Thu, 14 Mar 2002 14:07:33 +0000 Subject: [PATCH] fix warning with undefined cfgPmaAbsoluteUri --- ChangeLog | 3 +++ main.php3 | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba1f54f91..f5178fb3d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-03-14 Steve Alberty + * main.php3: fix warning with undefined $cfgPmaAbsoluteUri + 2002-03-14 Marc Delisle * libraries/common.lib.php3, PMA_MYSQL_INT_VERSION is not yet defined before the connection diff --git a/main.php3 b/main.php3 index 945ea96a0..1ca002f06 100755 --- a/main.php3 +++ b/main.php3 @@ -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