From 8eefbb2158c43b51a8c33e6c480cbe61539b9535 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 27 Aug 2012 04:16:04 -0400
Subject: [PATCH] Add option to enable HTML editor on forwarding (#1488517)

---
 program/include/rcube_db_sqlite.php |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/program/include/rcube_db_sqlite.php b/program/include/rcube_db_sqlite.php
index 0b41ef5..a9774cd 100644
--- a/program/include/rcube_db_sqlite.php
+++ b/program/include/rcube_db_sqlite.php
@@ -45,7 +45,12 @@
     {
         // Create database file, required by PDO to exist on connection
         if (!empty($dsn['database']) && !file_exists($dsn['database'])) {
-            touch($dsn['database']);
+            $created = touch($dsn['database']);
+
+            // File mode setting, for compat. with MDB2
+            if (!empty($dsn['mode']) && $created) {
+                chmod($dsn['database'], octdec($dsn['mode']));
+            }
         }
     }
 
@@ -63,14 +68,12 @@
             $data = file_get_contents(INSTALL_PATH . 'SQL/sqlite.initial.sql');
 
             if (strlen($data)) {
-                if ($this->options['debug_mode']) {
-                    $this::debug('INITIALIZE DATABASE');
-                }
+                $this->debug('INITIALIZE DATABASE');
 
                 $q = $dbh->exec($data);
 
                 if ($q === false) {
-                    $error = $this->dbh->errorInfo();
+                    $error = $dbh->errorInfo();
                     $this->db_error = true;
                     $this->db_error_msg = sprintf('[%s] %s', $error[1], $error[2]);
 

--
Gitblit v1.9.1