Even more checking whether writing actually succeeds.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jan 2005 19:11:45 +0000 (19:11 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jan 2005 19:11:45 +0000 (19:11 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8702 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/squirrelspell/modules/check_me.mod

index d0594fd1d49e9670f8afa6a7e5e9021138e7cc71..d892f4a8818885a9ac6c2fb1d5233802df4d7c43 100644 (file)
@@ -97,7 +97,10 @@ if( check_php_version ( 4, 3 ) ) {
         error_box ( _("Could not run the spellchecker command (%s).",
             htmlspecialchars($sqspell_command) ) , $color );
     }
-    fwrite($pipes[0], $sqspell_new_text);
+    if ( ! @fwrite($pipes[0], $sqspell_new_text) ) {
+        error_box ( _("Error while writing to pipe.",
+            htmlspecialchars($floc) ) , $color );
+    }
     fclose($pipes[0]);
     $sqspell_output = array();
     for($i=1; $i<=2; $i++) {
@@ -116,7 +119,10 @@ if( check_php_version ( 4, 3 ) ) {
         error_box ( _("Could not open temporary file '%s'.",
             htmlspecialchars($floc) ) , $color );
     }
-    fwrite($fp, $sqspell_new_text);
+    if ( ! @fwrite($fp, $sqspell_new_text) ) {
+        error_box ( _("Error while writing to temporary file '%s'.",
+            htmlspecialchars($floc) ) , $color );
+    }
     fclose($fp);
     exec("$sqspell_command < $floc 2>&1", $sqspell_output, $sqspell_exitcode);
     unlink($floc);