Adding error reporting routines, by popular demand. :)
authorgraf25 <graf25@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 6 Mar 2002 02:09:21 +0000 (02:09 +0000)
committergraf25 <graf25@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 6 Mar 2002 02:09:21 +0000 (02:09 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2545 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/squirrelspell/modules/check_me.mod
plugins/squirrelspell/sqspell_functions.php

index 65428a509dd9249e31a181e40d2dc47a4eb52c6b..370241f1621628dd66fc9c772496bae6dfb1415e 100644 (file)
@@ -101,12 +101,27 @@ fclose($fp);
 /**
  * Execute ispell/aspell and catch the output.
  */
 /**
  * Execute ispell/aspell and catch the output.
  */
-exec("cat $floc | $sqspell_command", $sqspell_output);
+exec("cat $floc | $sqspell_command 2>&1", $sqspell_output, $sqspell_exitcode);
 /**
  * Remove the temp file.
  */
 unlink($floc);
 
 /**
  * Remove the temp file.
  */
 unlink($floc);
 
+/**
+ * Check if the execution was successful. Bail out if it wasn't.
+ */
+if ($sqspell_exitcode){
+  $msg= "<div align='center'>"
+     . sprintf(_("I tried to execute '%s', but it returned:"),
+               $sqspell_command) . "<pre>"
+     . nl2br(join("\n", $sqspell_output)) . "</pre>"
+     . "<form onsubmit=\"return false\">"
+     . "<input type=\"submit\" value=\"  " . _("Close")
+     . "  \" onclick=\"self.close()\"></form></div>";
+  sqspell_makeWindow(null, _("SquirrelSpell is misconfigured."), null, $msg);
+  exit;
+}
+
 /**
  * Load the user dictionary.
  */
 /**
  * Load the user dictionary.
  */
index 189a0e206ccd2fbaef62c09894c718355d624a9b..333083a34925f2e05e5699edab802b8d7baf21f2 100644 (file)
@@ -513,5 +513,5 @@ function sqspell_ckMOD($rMOD){
  * of the user dictionary files and messing with this can do ugly 
  * stuff. :)
  */
  * of the user dictionary files and messing with this can do ugly 
  * stuff. :)
  */
-$SQSPELL_VERSION="v0.3.7";
+$SQSPELL_VERSION="v0.3.8";
 ?>
 ?>