From 4ec447ce4eb7097c07ac561ca5ecdbb7d0ea7714 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 11 Sep 2008 12:38:52 +0000 Subject: [PATCH] Fixes for header.php if database connection is lost --- inc/databases.php | 2 +- inc/header.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 900e938e2b..60045547c1 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "297"); +define('CURR_SVN_REVISION', "298"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/header.php b/inc/header.php index cbb11da08d..ce152eaad0 100644 --- a/inc/header.php +++ b/inc/header.php @@ -50,8 +50,10 @@ if (($header != "1") && ($header != "2")) { // Add title decorations? (left) if (!defined('__PAGE_TITLE')) { - if ((count($_CONFIG) > 1) && (is_resource($link)) && (isset($db))) { - if (($_CONFIG['enable_title_deco'] == "Y") && (trim(!empty($_CONFIG['title_left'])))) $TITLE .= trim($_CONFIG['title_left'])." "; + // Config and database connection valid? + if ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 1) && (is_resource($link)) && (isset($db))) { + // Title decoration enabled? + if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_left']))) $TITLE .= trim($_CONFIG['title_left'])." "; $TITLE .= MAIN_TITLE; // Add title of module? (middle decoration will also be added!) @@ -84,7 +86,7 @@ if (($header != "1") && ($header != "2")) { define('__PAGE_TITLE', NO_CONFIG_FOUND_TITLE); // Do not add the fatal message in installation mode - if (basename($_SERVER['SELF']) != "install.php") ADD_FATAL(NO_CONFIG_FOUND); + if (basename($_SERVER['PHP_SELF']) != "install.php") ADD_FATAL(NO_CONFIG_FOUND); } } -- 2.39.5