From b38e97d5419a80763653dc2cd61f0c418f2a8177 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 29 Nov 2009 14:44:05 +0000 Subject: [PATCH] Fixes for 'empty extension version bug' --- inc/classes/cachesystem.class.php | 4 ++-- inc/extensions-functions.php | 4 ++-- inc/filter-functions.php | 2 +- inc/header.php | 3 +++ inc/modules/admin/admin-inc.php | 2 +- inc/modules/admin/overview-inc.php | 4 ++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index 4c23235ac2..e2640ed3d7 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -89,8 +89,8 @@ class CacheSystem { // Pre-fetch cache here if found if ($this->isCacheReadable()) $this->getArrayFromCache(); - //* DEBUG: */ print($cacheName.'='.intval($this->isCacheReadable()).'/'.intval(is_writeable($this->fqfn)).'/'.intval($this->extensionVersionMatches('cache')).'
'); - $this->status[$cacheName] = ($this->isCacheReadable() && (is_writeable($this->fqfn)) && ($this->extensionVersionMatches('cache'))); + //* DEBUG: */ print($cacheName.'='.intval($this->isCacheReadable()).'/'.intval(is_writeable($this->fqfn)).'/'.intval(isExtensionInstalled('cache')).'/'.intval($this->extensionVersionMatches('cache')).'
'); + $this->status[$cacheName] = ($this->isCacheReadable() && (is_writeable($this->fqfn)) && (isExtensionInstalled('cache')) && ($this->extensionVersionMatches('cache'))); } // END - if //* DEBUG: */ print($cacheName.'='.intval($this->status[$cacheName]).'
'); diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index c73a57fe4c..b3421876b5 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -682,7 +682,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false $OUT = ''; // Do we have queries? - if ((getExtensionVersion('sql_patches') >= '0.0.7') && (getConfig('verbose_sql') == 'Y')) { + if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) { // Init switch color $SW = 2; @@ -721,7 +721,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false // Load main template $OUT = loadTemplate('admin_ext_sql_table', true, $content); - } elseif ((getExtensionVersion('sql_patches') >= '0.0.7') && (getConfig('verbose_sql') == 'Y')) { + } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) { // No addional SQL commands to run $OUT = loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_ADDITIONAL_SQLS')); } // END - if diff --git a/inc/filter-functions.php b/inc/filter-functions.php index d096c8e43b..5088da4b23 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -118,9 +118,9 @@ ORDER BY // Init filters registerFilter('init', 'LOAD_CONFIGURATION'); + registerFilter('init', 'LOAD_RUNTIME_INCLUDES'); registerFilter('init', 'INIT_EXTENSIONS'); registerFilter('init', 'INIT_RANDOMIZER'); - registerFilter('init', 'LOAD_RUNTIME_INCLUDES'); registerFilter('init', 'INIT_RANDOM_NUMBER'); registerFilter('init', 'CHECK_SVN_REVISION'); registerFilter('init', 'RUN_DAILY_RESET'); diff --git a/inc/header.php b/inc/header.php index d87acc2edd..8fa1486a72 100644 --- a/inc/header.php +++ b/inc/header.php @@ -43,6 +43,9 @@ if (!defined('__SECURITY')) { die(); } // END - if +// Init header +$GLOBALS['page_header'] = ''; + // Is the header already sent? if (($GLOBALS['header_sent'] != 1) && ($GLOBALS['header_sent'] != 2)) { // If not in CSS mode generate the header diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 47d8c45e2d..76499f3675 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -197,7 +197,7 @@ function ifAdminLoginDataIsValid ($admin, $password) { // Try to login the admin by setting some session/cookie variables function doAdminLogin ($adminLogin, $passHash) { // Reset failure counter on matching admins version - if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) { + if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) { // Reset counter on out-dated sql_patches version SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `login_failures`=0, `last_failure`='0000-00-00 00:00:00' WHERE `login`='%s' LIMIT 1", array($adminLogin), __FUNCTION__, __LINE__); diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 0b8b56becd..9586233e83 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -242,9 +242,9 @@ LIMIT 1", } // Add SQLs to a table - if ((!empty($ext_name)) && (getExtensionVersion('sql_patches')) && (getConfig('verbose_sql') == 'Y')) { + if ((!empty($ext_name)) && (isExtensionInstalled('sql_patches')) && (getConfig('verbose_sql') == 'Y')) { // Add verbose SQL table - $text .= addExtensionVerboseSqlTable($title, " class=\"admin_table top left right\"", true, '100%') . "
\n"; + $text .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . "
\n"; } // END - if } elseif ((!empty($ext_name)) && (!empty($ext_ver))) { // Run SQL commands in dry mode but only return the notes -- 2.39.5