]> granicus.if.org Git - php/commitdiff
- Fix file_put_contents() usage: it returns bytes written and it can be 0.
authorfoobar <sniper@php.net>
Wed, 7 Dec 2005 11:11:01 +0000 (11:11 +0000)
committerfoobar <sniper@php.net>
Wed, 7 Dec 2005 11:11:01 +0000 (11:11 +0000)
run-tests.php

index e61e109b90f28547cb4c988eea423b3183bcc7eb..4c6e3deb12479b498e4e2448fe67dfd854f339f6 100755 (executable)
@@ -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);