alecpl
2010-09-25 e019f2d0f2dc2fbfa345ab5d7ae85e67bfdd76b8
program/steps/utils/spell_html_googie.inc
@@ -4,8 +4,8 @@
 +-----------------------------------------------------------------------+
 | program/steps/utils/spell_html_googie.inc                             |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland                 |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
@@ -30,7 +30,7 @@
    $store = '';
    if ($fp = fsockopen($host, $port, $errno, $errstr, 30)) {
        $out = "POST $path HTTP/1.0\r\n";
        $out .= "Host: $host\r\n";
        $out .= "Host: " . str_replace('ssl://', '', $host) . "\r\n";
        $out .= "Content-Length: " . strlen($data) . "\r\n";
        $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $out .= "Connection: Close\r\n\r\n";
@@ -93,10 +93,14 @@
        $result['result'][] = mb_substr($wordstr, $matches[$i][1], $matches[$i][2], RCMAIL_CHARSET);
}
else if ($request['method'] == 'getSuggestions') {
    $suggestions = explode("\t", $matches[0][4]);
    if (sizeof($suggestions)>MAX_SUGGESTIONS)
        $suggestions = array_slice($suggestions, 0, MAX_SUGGESTIONS);
    $result['result'] = $suggestions;
    if ($matches[0][4]) {
        $suggestions = explode("\t", $matches[0][4]);
        if (sizeof($suggestions)>MAX_SUGGESTIONS)
            $suggestions = array_slice($suggestions, 0, MAX_SUGGESTIONS);
        $result['result'] = $suggestions;
    }
    else
        $result['result'] = array();
}
// send output