From e14cdc034ea373c649fcaf7596a5ff3479991fc7 Mon Sep 17 00:00:00 2001 From: foobar Date: Wed, 7 Dec 2005 11:11:01 +0000 Subject: [PATCH] - Fix file_put_contents() usage: it returns bytes written and it can be 0. --- run-tests.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/run-tests.php b/run-tests.php index e61e109b90f..4c6e3deb124 100755 --- a/run-tests.php +++ b/run-tests.php @@ -708,11 +708,13 @@ function mail_qa_team($data, $compression, $status = FALSE) // Write the given text to a temporary file, and return the filename. // -function save_text($filename,$text) +function save_text($filename, $text) { global $DETAILED; - @file_put_contents($filename, $text) or error("Cannot open file '" . $filename . "' (save_text)"); + if (@file_put_contents($filename, $text) === FALSE) { + error("Cannot open file '" . $filename . "' (save_text)"); + } if (1 < $DETAILED) echo " FILE $filename {{{ $text @@ -724,7 +726,7 @@ $text // Write an error in a format recognizable to Emacs or MSVC. // -function error_report($testname,$logname,$tested) +function error_report($testname, $logname, $tested) { $testname = realpath($testname); $logname = realpath($logname);