4 +-----------------------------------------------------------------------+
5 | program/steps/utils/spell.inc |
7 | This file is part of the Roundcube Webmail client |
8 | Copyright (C) 2005-2011, The Roundcube Dev Team |
9 | Licensed under the GNU GPL |
12 | Invoke the configured or default spell checking engine. |
14 +-----------------------------------------------------------------------+
15 | Author: Kris Steinhoff <steinhof@umich.edu> |
16 +-----------------------------------------------------------------------+
18 $Id: spell.inc 4815 2011-05-30 15:08:26Z alec $
23 $lang = get_input_value('lang', RCUBE_INPUT_GET);
24 $data = file_get_contents('php://input');
27 $left = strpos($data, '<text>');
28 $right = strrpos($data, '</text>');
29 $data = substr($data, $left+6, $right-($left+6));
30 $data = html_entity_decode($data, ENT_QUOTES, RCMAIL_CHARSET);
32 $spellchecker = new rcube_spellchecker($lang);
33 $spellchecker->check($data);
34 $result = $spellchecker->get_xml();
36 // set response length
37 header("Content-Length: " . strlen($result));
39 // Don't use server's default Content-Type charset (#1486406)
40 header("Content-Type: text/xml; charset=" . RCMAIL_CHARSET);