From fbe54043cf598b19a753dc2b21a7ed558d23fd15 Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Thu, 18 Aug 2011 13:40:07 -0400 Subject: [PATCH] Fix folders drop-down list: descend into root folder (e.g. INBOX) even if part of the exception list --- program/include/rcube_spellchecker.php | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/program/include/rcube_spellchecker.php b/program/include/rcube_spellchecker.php index 7acb700..8282406 100644 --- a/program/include/rcube_spellchecker.php +++ b/program/include/rcube_spellchecker.php @@ -52,7 +52,7 @@ { $this->rc = rcmail::get_instance(); $this->engine = $this->rc->config->get('spellcheck_engine', 'googie'); - $this->lang = $lang; + $this->lang = $lang ? $lang : 'en'; if ($this->engine == 'pspell' && !extension_loaded('pspell')) { raise_error(array( @@ -161,6 +161,29 @@ /** + * Returns checking result (mispelled words with suggestions) + * + * @return array Spellchecking result. An array indexed by word. + */ + function get() + { + $result = array(); + + foreach ($this->matches as $item) { + if ($this->engine == 'pspell') { + $word = $item[0]; + } + else { + $word = mb_substr($this->content, $item[1], $item[2], RCMAIL_CHARSET); + } + $result[$word] = is_array($item[4]) ? implode("\t", $item[4]) : $item[4]; + } + + return $out; + } + + + /** * Returns error message * * @return string Error message -- Gitblit v1.9.1