From 2612ebe5e9fc1124c271a4e422d9a2a8aa56d1cc Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Thu, 2 May 2024 03:08:48 -0700 Subject: [PATCH] Verify group exists before creating .db3 file for articles. --- Rocksolid_Light/rocksolid/newsportal.php | 10 ++++++++++ Rocksolid_Light/version.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 70dc285..cd40ba3 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1707,6 +1707,16 @@ function overview_db_open($database, $table = 'overview') function article_db_open($database, $table = 'articles') { + global $spooldir, $logdir, $config_name; + $logfile = $logdir . '/debug.log'; + $spoolpath = "/" . preg_replace("/\//", "\/", $spooldir) . "/"; + $group = preg_replace("/\-articles\.db3/", "", $database); + $group = preg_replace($spoolpath, "", $group); + $group = preg_replace("/\//", "", $group); + if(!get_section_by_group($group)) { + file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Attempt to create: " . $database . " for: " . $group, FILE_APPEND); + return false; + } try { $dbh = new PDO('sqlite:' . $database); } catch (PDOException $e) { diff --git a/Rocksolid_Light/version.txt b/Rocksolid_Light/version.txt index e3e1807..5204e3a 100644 --- a/Rocksolid_Light/version.txt +++ b/Rocksolid_Light/version.txt @@ -1 +1 @@ -0.9.8 +0.9.81