From fd152cf2efcd82e587e1d01767dc238204ee77e2 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 11 Feb 2024 19:50:26 +0700 Subject: [PATCH] Update demo_mode.php --- library/includes/cron/jobs/demo_mode.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/includes/cron/jobs/demo_mode.php b/library/includes/cron/jobs/demo_mode.php index b8bb59a78..aa46ac8cb 100644 --- a/library/includes/cron/jobs/demo_mode.php +++ b/library/includes/cron/jobs/demo_mode.php @@ -16,6 +16,7 @@ set_time_limit(600); global $cron_runtime_log; +define('SELECTED_DB', DB()->selected_db); $dump_path = BB_ROOT . 'install/sql/mysql.sql'; if (!IN_DEMO_MODE || !is_file($dump_path) || !is_readable($dump_path)) { @@ -25,12 +26,12 @@ if (!IN_DEMO_MODE || !is_file($dump_path) || !is_readable($dump_path)) { $sql_dump = file_get_contents($dump_path); // Delete database -if (!DB()->query("DROP DATABASE " . DB()->selected_db)) { +if (!DB()->query("DROP DATABASE " . SELECTED_DB)) { return; } // Create database -if (!DB()->query("CREATE DATABASE " . DB()->selected_db)) { +if (!DB()->query("CREATE DATABASE " . SELECTED_DB)) { return; }