1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

- Fix file_put_contents() usage: it returns bytes written and it can be 0.

This commit is contained in:
foobar
2005-12-07 11:11:01 +00:00
parent 3b66cc9c37
commit e14cdc034e

View File

@@ -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);