From eb604a566e52a4d1d63b4095d5f8f0f96cd988b4 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 31 May 2023 21:52:48 +0700 Subject: [PATCH] Fixed: Automatic conversion of false to array is deprecated (#750) --- admin/index.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index 8bf9b08c8..8bd9c2963 100644 --- a/admin/index.php +++ b/admin/index.php @@ -12,9 +12,11 @@ require __DIR__ . '/pagestart.php'; // Generate relevant output if (isset($_GET['pane']) && $_GET['pane'] == 'left') { $module = []; - if (!$module = CACHE('bb_cache')->get('admin_module_' . $user->id)) { + + // Scan modules + if (!CACHE('bb_cache')->get('admin_module_' . $user->id)) { $dir = opendir('.'); - $setmodules = 1; + $setmodules = true; while ($file = readdir($dir)) { if (preg_match('/^admin_.*?\.php$/', $file)) { include './' . $file; @@ -22,9 +24,14 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { } unset($setmodules); closedir($dir); + + // Set modules into cache CACHE('bb_cache')->set('admin_module_' . $user->id, $module, 600); } + // Get modules from cache + $module = CACHE('bb_cache')->get('admin_module_' . $user->id); + $template->assign_vars(array( 'TPL_ADMIN_NAVIGATE' => true, 'U_FORUM_INDEX' => '../index.php',