From 0c259682f65eaaf23ea4ccb56a706d6baf3007e4 Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 13 Apr 2012 08:52:02 +0000 Subject: - Merge devel-framework branch, resolved conflicts --- program/include/rcube_spellchecker.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'program/include/rcube_spellchecker.php') diff --git a/program/include/rcube_spellchecker.php b/program/include/rcube_spellchecker.php index a6f391346..8dfc3ead1 100644 --- a/program/include/rcube_spellchecker.php +++ b/program/include/rcube_spellchecker.php @@ -61,7 +61,7 @@ class rcube_spellchecker $this->lang = $lang ? $lang : 'en'; if ($this->engine == 'pspell' && !extension_loaded('pspell')) { - raise_error(array( + rcube::raise_error(array( 'code' => 500, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Pspell extension not available"), true, true); @@ -535,7 +535,7 @@ class rcube_spellchecker private function update_dict() { if (strcasecmp($this->options['dictionary'], 'shared') != 0) { - $userid = (int) $this->rc->user->ID; + $userid = $this->rc->get_user_id(); } $plugin = $this->rc->plugins->exec_hook('spell_dictionary_save', array( @@ -548,24 +548,24 @@ class rcube_spellchecker if ($this->have_dict) { if (!empty($this->dict)) { $this->rc->db->query( - "UPDATE ".get_table_name('dictionary') + "UPDATE ".$this->rc->db->table_name('dictionary') ." SET data = ?" - ." WHERE user_id " . ($plugin['userid'] ? "= ".$plugin['userid'] : "IS NULL") + ." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?", implode(' ', $plugin['dictionary']), $plugin['language']); } // don't store empty dict else { $this->rc->db->query( - "DELETE FROM " . get_table_name('dictionary') - ." WHERE user_id " . ($plugin['userid'] ? "= ".$plugin['userid'] : "IS NULL") + "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') . " = ?", $plugin['language']); } } else if (!empty($this->dict)) { $this->rc->db->query( - "INSERT INTO " .get_table_name('dictionary') + "INSERT INTO " .$this->rc->db->table_name('dictionary') ." (user_id, " . $this->rc->db->quoteIdentifier('language') . ", data) VALUES (?, ?, ?)", $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary'])); } @@ -582,7 +582,7 @@ class rcube_spellchecker } if (strcasecmp($this->options['dictionary'], 'shared') != 0) { - $userid = (int) $this->rc->user->ID; + $userid = $this->rc->get_user_id(); } $plugin = $this->rc->plugins->exec_hook('spell_dictionary_get', array( @@ -591,8 +591,8 @@ class rcube_spellchecker if (empty($plugin['abort'])) { $dict = array(); $this->rc->db->query( - "SELECT data FROM ".get_table_name('dictionary') - ." WHERE user_id ". ($plugin['userid'] ? "= ".$plugin['userid'] : "IS NULL") + "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') . " = ?", $plugin['language']); -- cgit v1.2.3