From 7fface125e7db1e7ab47bdfbda5306fa16ea2486 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 25 Apr 2014 03:56:22 -0400
Subject: [PATCH] Fix error when spell-checking an empty text (#1489831)

---
 program/steps/utils/spell.inc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/program/steps/utils/spell.inc b/program/steps/utils/spell.inc
index c8807e3..696fa60 100644
--- a/program/steps/utils/spell.inc
+++ b/program/steps/utils/spell.inc
@@ -37,6 +37,9 @@
     $spellchecker->add_word($data);
     $result = '<?xml version="1.0" encoding="'.RCUBE_CHARSET.'"?><learnwordresult></learnwordresult>';
 }
+else if (empty($data)) {
+    $result = '<?xml version="1.0" encoding="'.RCUBE_CHARSET.'"?><spellresult charschecked="0"></spellresult>';
+}
 else {
     $spellchecker->check($data);
     $result = $spellchecker->get_xml();

--
Gitblit v1.9.1