summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_spellchecker.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-09-12 14:37:51 +0200
committerAleksander Machniak <alec@alec.pl>2014-09-12 14:37:51 +0200
commit34a0902089a410d1f7dda78d1f8b0771333c09df (patch)
tree729c7a994d64b7dbf9f78656d95b34846cae58ba /program/lib/Roundcube/rcube_spellchecker.php
parent8cc65d1f5fae71e2ee07748e82ab274d8d45304b (diff)
Use consistent column/table quoting in sql queries
Diffstat (limited to 'program/lib/Roundcube/rcube_spellchecker.php')
-rw-r--r--program/lib/Roundcube/rcube_spellchecker.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php
index 43bab08c4..062780720 100644
--- a/program/lib/Roundcube/rcube_spellchecker.php
+++ b/program/lib/Roundcube/rcube_spellchecker.php
@@ -360,25 +360,25 @@ class rcube_spellchecker
if ($this->have_dict) {
if (!empty($this->dict)) {
$this->rc->db->query(
- "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->quote_identifier('language') . " = ?",
+ "UPDATE " . $this->rc->db->table_name('dictionary', true)
+ ." SET `data` = ?"
+ ." WHERE `user_id` " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
+ ." AND `language` = ?",
implode(' ', $plugin['dictionary']), $plugin['language']);
}
// don't store empty dict
else {
$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->quote_identifier('language') . " = ?",
+ "DELETE FROM " . $this->rc->db->table_name('dictionary', true)
+ ." WHERE `user_id` " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
+ ." AND `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->quote_identifier('language') . ", data) VALUES (?, ?, ?)",
+ "INSERT INTO " . $this->rc->db->table_name('dictionary', true)
+ ." (`user_id`, `language`, `data`) VALUES (?, ?, ?)",
$plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary']));
}
}
@@ -403,9 +403,9 @@ class rcube_spellchecker
if (empty($plugin['abort'])) {
$dict = array();
$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->quote_identifier('language') . " = ?",
+ "SELECT `data` FROM " . $this->rc->db->table_name('dictionary', true)
+ ." WHERE `user_id` ". ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
+ ." AND `language` = ?",
$plugin['language']);
if ($sql_arr = $this->rc->db->fetch_assoc($sql_result)) {
@@ -427,5 +427,4 @@ class rcube_spellchecker
return $this->dict;
}
-
}