From 3b8a7918fc315f71fe48608060588e026b55d85a Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 20 Nov 2013 14:09:13 -0500
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail

---
 temp/.gitignore                              |    1 +
 logs/.gitignore                              |    1 +
 program/lib/Roundcube/rcube_contacts.php     |    8 ++++----
 program/lib/Roundcube/rcube_user.php         |   26 +++++++++++++-------------
 program/lib/Roundcube/rcube_spellchecker.php |    8 ++++----
 5 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/logs/.gitignore b/logs/.gitignore
new file mode 100644
index 0000000..f59ec20
--- /dev/null
+++ b/logs/.gitignore
@@ -0,0 +1 @@
+*
\ No newline at end of file
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index 5c9e5ab..2e03352 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -350,7 +350,7 @@
                 if (in_array($col, $this->table_cols)) {
                     switch ($mode) {
                     case 1: // strict
-                        $where[] = '(' . $this->db->quoteIdentifier($col) . ' = ' . $this->db->quote($val)
+                        $where[] = '(' . $this->db->quote_identifier($col) . ' = ' . $this->db->quote($val)
                             . ' OR ' . $this->db->ilike($col, $val . $AS . '%')
                             . ' OR ' . $this->db->ilike($col, '%' . $AS . $val . $AS . '%')
                             . ' OR ' . $this->db->ilike($col, '%' . $AS . $val) . ')';
@@ -390,7 +390,7 @@
         }
 
         foreach (array_intersect($required, $this->table_cols) as $col) {
-            $and_where[] = $this->db->quoteIdentifier($col).' <> '.$this->db->quote('');
+            $and_where[] = $this->db->quote_identifier($col).' <> '.$this->db->quote('');
         }
 
         if (!empty($where)) {
@@ -630,7 +630,7 @@
         $a_insert_cols = $a_insert_values = array();
 
         foreach ($save_data as $col => $value) {
-            $a_insert_cols[]   = $this->db->quoteIdentifier($col);
+            $a_insert_cols[]   = $this->db->quote_identifier($col);
             $a_insert_values[] = $this->db->quote($value);
         }
 
@@ -665,7 +665,7 @@
         $save_cols = $this->convert_save_data($save_cols, $record);
 
         foreach ($save_cols as $col => $value) {
-            $write_sql[] = sprintf("%s=%s", $this->db->quoteIdentifier($col), $this->db->quote($value));
+            $write_sql[] = sprintf("%s=%s", $this->db->quote_identifier($col), $this->db->quote($value));
         }
 
         if (!empty($write_sql)) {
diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php
index 3182ff3..5b77bda 100644
--- a/program/lib/Roundcube/rcube_spellchecker.php
+++ b/program/lib/Roundcube/rcube_spellchecker.php
@@ -352,7 +352,7 @@
                     "UPDATE ".$this->rc->db->table_name('dictionary')
                     ." SET data = ?"
                     ." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
-                        ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
+                        ." AND " . $this->rc->db->quote_identifier('language') . " = ?",
                     implode(' ', $plugin['dictionary']), $plugin['language']);
             }
             // don't store empty dict
@@ -360,14 +360,14 @@
                 $this->rc->db->query(
                     "DELETE FROM " . $this->rc->db->table_name('dictionary')
                     ." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
-                        ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
+                        ." AND " . $this->rc->db->quote_identifier('language') . " = ?",
                     $plugin['language']);
             }
         }
         else if (!empty($this->dict)) {
             $this->rc->db->query(
                 "INSERT INTO " .$this->rc->db->table_name('dictionary')
-                ." (user_id, " . $this->rc->db->quoteIdentifier('language') . ", data) VALUES (?, ?, ?)",
+                ." (user_id, " . $this->rc->db->quote_identifier('language') . ", data) VALUES (?, ?, ?)",
                 $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary']));
         }
     }
@@ -394,7 +394,7 @@
             $sql_result = $this->rc->db->query(
                 "SELECT data FROM ".$this->rc->db->table_name('dictionary')
                 ." WHERE user_id ". ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
-                    ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
+                    ." AND " . $this->rc->db->quote_identifier('language') . " = ?",
                 $plugin['language']);
 
             if ($sql_arr = $this->rc->db->fetch_assoc($sql_result)) {
diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php
index 3e4be0a..1d5a905 100644
--- a/program/lib/Roundcube/rcube_user.php
+++ b/program/lib/Roundcube/rcube_user.php
@@ -265,7 +265,7 @@
             "SELECT * FROM ".$this->db->table_name('identities').
             " WHERE del <> 1 AND user_id = ?".
             ($sql_add ? " ".$sql_add : "").
-            " ORDER BY ".$this->db->quoteIdentifier('standard')." DESC, name ASC, identity_id ASC",
+            " ORDER BY ".$this->db->quote_identifier('standard')." DESC, name ASC, identity_id ASC",
             $this->ID);
 
         while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
@@ -300,7 +300,7 @@
         $query_cols = $query_params = array();
 
         foreach ((array)$data as $col => $value) {
-            $query_cols[]   = $this->db->quoteIdentifier($col) . ' = ?';
+            $query_cols[]   = $this->db->quote_identifier($col) . ' = ?';
             $query_params[] = $value;
         }
         $query_params[] = $iid;
@@ -336,7 +336,7 @@
 
         $insert_cols = $insert_values = array();
         foreach ((array)$data as $col => $value) {
-            $insert_cols[]   = $this->db->quoteIdentifier($col);
+            $insert_cols[]   = $this->db->quote_identifier($col);
             $insert_values[] = $value;
         }
         $insert_cols[]   = 'user_id';
@@ -401,7 +401,7 @@
         if ($this->ID && $iid) {
             $this->db->query(
                 "UPDATE ".$this->db->table_name('identities').
-                " SET ".$this->db->quoteIdentifier('standard')." = '0'".
+                " SET ".$this->db->quote_identifier('standard')." = '0'".
                 " WHERE user_id = ?".
                     " AND identity_id <> ?".
                     " AND del <> 1",
@@ -641,11 +641,11 @@
         $result = array();
 
         $sql_result = $this->db->query(
-            "SELECT search_id AS id, ".$this->db->quoteIdentifier('name')
+            "SELECT search_id AS id, ".$this->db->quote_identifier('name')
             ." FROM ".$this->db->table_name('searches')
             ." WHERE user_id = ?"
-                ." AND ".$this->db->quoteIdentifier('type')." = ?"
-            ." ORDER BY ".$this->db->quoteIdentifier('name'),
+                ." AND ".$this->db->quote_identifier('type')." = ?"
+            ." ORDER BY ".$this->db->quote_identifier('name'),
             (int) $this->ID, (int) $type);
 
         while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
@@ -673,9 +673,9 @@
         }
 
         $sql_result = $this->db->query(
-            "SELECT ".$this->db->quoteIdentifier('name')
-                .", ".$this->db->quoteIdentifier('data')
-                .", ".$this->db->quoteIdentifier('type')
+            "SELECT ".$this->db->quote_identifier('name')
+                .", ".$this->db->quote_identifier('data')
+                .", ".$this->db->quote_identifier('type')
             ." FROM ".$this->db->table_name('searches')
             ." WHERE user_id = ?"
                 ." AND search_id = ?",
@@ -730,11 +730,11 @@
 
         $insert_cols[]   = 'user_id';
         $insert_values[] = (int) $this->ID;
-        $insert_cols[]   = $this->db->quoteIdentifier('type');
+        $insert_cols[]   = $this->db->quote_identifier('type');
         $insert_values[] = (int) $data['type'];
-        $insert_cols[]   = $this->db->quoteIdentifier('name');
+        $insert_cols[]   = $this->db->quote_identifier('name');
         $insert_values[] = $data['name'];
-        $insert_cols[]   = $this->db->quoteIdentifier('data');
+        $insert_cols[]   = $this->db->quote_identifier('data');
         $insert_values[] = serialize($data['data']);
 
         $sql = "INSERT INTO ".$this->db->table_name('searches')
diff --git a/temp/.gitignore b/temp/.gitignore
new file mode 100644
index 0000000..f59ec20
--- /dev/null
+++ b/temp/.gitignore
@@ -0,0 +1 @@
+*
\ No newline at end of file

--
Gitblit v1.9.1