Verify group exists before creating .db3 file for articles.

This commit is contained in:
Retro_Guy 2024-05-02 03:08:48 -07:00
parent 5bb446597b
commit 2612ebe5e9
2 changed files with 11 additions and 1 deletions

View File

@ -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) {

View File

@ -1 +1 @@
0.9.8
0.9.81