Avoid creating thread dbs for groups that do not exist.
This commit is contained in:
parent
7622cc4e3c
commit
057fca590a
|
@ -1 +1 @@
|
|||
0.9.11
|
||||
0.9.12
|
||||
|
|
|
@ -1748,6 +1748,15 @@ function mail_db_open($database, $table = 'messages')
|
|||
|
||||
function threads_db_open($database, $table = "threads")
|
||||
{
|
||||
global $spooldir, $logdir, $config_name;
|
||||
$logfile = $logdir . '/debug.log';
|
||||
$spooldir_len = strlen($spooldir);
|
||||
$group = substr($database, $spooldir_len, (strlen($database) - $spooldir_len) - 9);
|
||||
$group = trim($group, '/');
|
||||
if (! get_section_by_group($group, true)) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue