alecpl
2010-06-30 9ed374bbe176b9c822f38ddd2d404fe0af6b781f
- fix for empty suggestions result


1 files modified
4 ■■■■ changed files
program/steps/utils/spell_html_googie.inc 4 ●●●● patch | view | raw | blame | history
program/steps/utils/spell_html_googie.inc
@@ -93,11 +93,15 @@
        $result['result'][] = mb_substr($wordstr, $matches[$i][1], $matches[$i][2], RCMAIL_CHARSET);
}
else if ($request['method'] == 'getSuggestions') {
    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
header("Content-Type: text/xml; charset=".RCMAIL_CHARSET);