summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-06-30 10:14:41 +0000
committeralecpl <alec@alec.pl>2010-06-30 10:14:41 +0000
commit9ed374bbe176b9c822f38ddd2d404fe0af6b781f (patch)
treee82c3374730d9ed4846c25f38df1c123807eea77 /program/steps
parent4eb8493b40d72d7895b838234e4bc9bbd2b558ed (diff)
- fix for empty suggestions result
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/utils/spell_html_googie.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/program/steps/utils/spell_html_googie.inc b/program/steps/utils/spell_html_googie.inc
index 292f303a3..ee9079dce 100644
--- a/program/steps/utils/spell_html_googie.inc
+++ b/program/steps/utils/spell_html_googie.inc
@@ -93,10 +93,14 @@ if ($request['method'] == 'checkWords') {
$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