Added isset() for fixing missing array element 'cache_instance'
authorRoland Häder <roland@mxchange.org>
Sat, 28 Feb 2009 21:57:04 +0000 (21:57 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 28 Feb 2009 21:57:04 +0000 (21:57 +0000)
inc/extensions.php
inc/modules/admin/admin-inc.php

index b5185fe..7ed3d49 100644 (file)
@@ -380,7 +380,7 @@ function GET_EXT_VERSION ($ext_name) {
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
-       } elseif (!is_object($GLOBALS['cache_instance'])) {
+       } elseif ((!isset($GLOBALS['cache_instance'])) || (!is_object($GLOBALS['cache_instance']))) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
                        array($ext_name), __FILE__, __LINE__);
index c960342..233ae66 100644 (file)
@@ -306,7 +306,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
        $GLOBALS['menu']['title'] = array();
 
        // Is there a cache instance?
-       if ((is_object($GLOBALS['cache_instance'])) && (getConfig('cache_admin_menu') == "Y")) {
+       if ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])) && (getConfig('cache_admin_menu') == "Y")) {
                // Create cache name
                $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
 
@@ -454,7 +454,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
        eval($eval);
 
        // Is there a cache instance again?
-       if ((is_object($GLOBALS['cache_instance'])) && (getConfig('cache_admin_menu') == "Y")) {
+       if ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])) && (getConfig('cache_admin_menu') == "Y")) {
                // Init cache
                $GLOBALS['cache_instance']->init($cacheName);