From 2fd96e6b1e3f337189d7a1a9561f1e8e2d1204c9 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 24 Jan 2005 19:11:45 +0000 Subject: [PATCH] Even more checking whether writing actually succeeds. 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/squirrelspell/modules/check_me.mod b/plugins/squirrelspell/modules/check_me.mod index d0594fd1..d892f4a8 100644 --- a/plugins/squirrelspell/modules/check_me.mod +++ b/plugins/squirrelspell/modules/check_me.mod @@ -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); -- 2.25.1