From 741d91a76b077c502d8c4622b83005c86db4f1a9 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 5 Jan 2021 10:04:26 -0800 Subject: [PATCH] Additional checks for constants. Disable addon lookup cache in debug mode. --- e107_admin/admin.php | 2 +- e107_admin/boot.php | 11 ++++++++--- e107_admin/cache.php | 1 + e107_core/templates/admin_icons_template.php | 2 +- e107_handlers/e107_class.php | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 2ff892e5a..56b72a081 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -258,7 +258,7 @@ class admin_start require(e_ADMIN."ver.php"); - if(!empty($e107info['e107_version']) && (e_VERSION !== $e107info['e107_version'])) + if(!empty($e107info['e107_version']) && defined('e_VERSION') && (e_VERSION !== $e107info['e107_version'])) { e107::getConfig()->set('version', $e107info['e107_version'])->save(false,true,false); diff --git a/e107_admin/boot.php b/e107_admin/boot.php index f968c7d9b..914a025b6 100644 --- a/e107_admin/boot.php +++ b/e107_admin/boot.php @@ -52,7 +52,10 @@ if(e_AJAX_REQUEST && getperms('0') && varset($_GET['mode']) == 'core' && ($_GET if(e_AJAX_REQUEST && getperms('0') && varset($_GET['mode']) == 'addons' && ($_GET['type'] == 'update')) { - e107::getSession()->set('addons-update-checked',true); + if(!E107_DEBUG_LEVEL) + { + e107::getSession()->set('addons-update-checked',true); + } /** @var admin_shortcodes $sc */ $sc = e107::getScBatch('admin'); @@ -63,7 +66,6 @@ if(e_AJAX_REQUEST && getperms('0') && varset($_GET['mode']) == 'addons' && ($_G $text = $sc->renderAddonUpdate($plugins); $text .= $sc->renderAddonUpdate($themes); - if(empty($text)) { exit; @@ -78,7 +80,10 @@ if(e_AJAX_REQUEST && getperms('0') && varset($_GET['mode']) == 'addons' && ($_G echo $ret; - e107::getSession()->set('addons-update-status',$ret); + if(!E107_DEBUG_LEVEL) + { + e107::getSession()->set('addons-update-status',$ret); + } exit; diff --git a/e107_admin/cache.php b/e107_admin/cache.php index f3cfadfd6..087c9b28c 100644 --- a/e107_admin/cache.php +++ b/e107_admin/cache.php @@ -61,6 +61,7 @@ if (isset($_POST['trigger_empty_cache'])) case 'empty_syscache': e107::getCache()->clearAll('system'); e107::getLog()->flushMessages(CACLAN_16); + e107::getSession()->clear('addons-update-status'); break; case 'empty_dbcache': diff --git a/e107_core/templates/admin_icons_template.php b/e107_core/templates/admin_icons_template.php index 8fe748738..8db2d3927 100644 --- a/e107_core/templates/admin_icons_template.php +++ b/e107_core/templates/admin_icons_template.php @@ -453,7 +453,7 @@ define("E_32_TRUE", ""); define("ADMIN_GRID_ICON", ""); define("ADMIN_LIST_ICON", ""); -if(THEME_STYLE === 'css/kadmin.css') +if(defset('THEME_STYLE') === 'css/kadmin.css') { define("ADMIN_EDIT_ICON", ""); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index e12162d2f..f94911a6f 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2967,7 +2967,7 @@ class e107 { $ret = $legacy_override_path; } - elseif(THEME_LEGACY === true && is_readable($core_path_legacy)) //v1 core template. + elseif(deftrue('THEME_LEGACY') && is_readable($core_path_legacy)) //v1 core template. { $ret = $core_path_legacy; } @@ -4199,7 +4199,7 @@ class e107 //$GLOBALS['_E107'] - minimal mode - here because of the e_AJAX_REQUEST if(isset($GLOBALS['_E107']['minimal']) || e_AJAX_REQUEST || deftrue('e_MINIMAL')) { - $_e107vars = array('forceuserupdate', 'online', 'theme', 'menus', 'prunetmp'); + $_e107vars = array('forceuserupdate', 'online', 'menus', 'prunetmp'); $GLOBALS['_E107']['minimal'] = true; // lame but quick - allow online when ajax request only, additonal checks are made in e_online class if(e_AJAX_REQUEST && !isset($GLOBALS['_E107']['online']) && !isset($GLOBALS['_E107']['minimal']))