}
$imp_ui->attachAutoCompleter($auto_complete);
if (!empty($conf['spell']['driver'])) {
- if (Horde_SpellChecker::factory($conf['spell']['driver'], array()) !== false) {
+ try {
+ Horde_SpellChecker::getInstance($conf['spell']['driver'], array());
$spellcheck = true;
$imp_ui->attachSpellChecker('imp', true);
+ } catch (Exception $e) {
+ Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
}
}
Horde::addScriptFile('ieEscGuard.js', 'horde', true);
$spellArgs['html'] = true;
}
- $speller = Horde_SpellChecker::factory(
- $GLOBALS['conf']['spell']['driver'], $spellArgs);
- if ($speller === false) {
+ try {
+ $speller = Horde_SpellChecker::getInstance($GLOBALS['conf']['spell']['driver'], $spellArgs);
+ } catch (Exception $e) {
+ Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
return array();
}
- $result = $speller->spellCheck(Util::getPost($args['input']));
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+ try {
+ return $speller->spellCheck(Util::getPost($args['input']));
+ } catch (Exception $e) {
+ Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
return array('bad' => array(), 'suggestions' => array());
- } else {
- return $result;
}
}