Aleksander Machniak
2014-05-02 cdf79e0926b5a45464a7c7ed8cbe4a5e827f95c6
program/steps/utils/spell_html.inc
@@ -35,7 +35,7 @@
$spellchecker = new rcube_spellchecker($lang);
if ($request['method'] == 'checkWords') {
    $result['result'] = $spellchecker->get_words($data);
    $result['result'] = empty($data) ? array() : $spellchecker->get_words($data);
}
else if ($request['method'] == 'getSuggestions') {
    $result['result'] = $spellchecker->get_suggestions($data);
@@ -46,12 +46,17 @@
}
if ($error = $spellchecker->error()) {
    rcube::raise_error(array('code' => 500, 'type' => 'php',
        'file' => __FILE__, 'line' => __LINE__,
        'message' => sprintf("Spell check engine error: " . $error)),
        true, false);
    echo '{"error":{"errstr":"' . addslashes($error) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}';
    exit;
}
// send output
header("Content-Type: text/xml; charset=".RCMAIL_CHARSET);
header("Content-Type: text/xml; charset=".RCUBE_CHARSET);
echo json_encode($result);
exit;