From 7447db1b219a0cc02d2642627f289b31e0e9abe4 Mon Sep 17 00:00:00 2001 From: azett Date: Thu, 23 Jun 2022 19:34:05 +0200 Subject: [PATCH] Fixed #43: LastComments plugin will not even attempt to delete or rebuild LastComments caches if LastComments plugin is not available. --- fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php b/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php index 330a55c..7df6958 100644 --- a/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php +++ b/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php @@ -26,6 +26,12 @@ if (class_exists('AdminPanelAction')) { function onsubmit($data = NULL) { global $fp_config; + // No action possible if LastComments plugin isn't activated! + if (!function_exists('plugin_lastcomments_cache')) { + $this->smarty->assign('success', -2); + return; + } + if (isset($_POST ['lastcommentadmin_clear'])) { fs_delete(LASTCOMMENTS_CACHE_FILE); $this->smarty->assign('success', 1);