From a4f1a3241fda15df244cf77613e1405a8d50810b Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 29 Mar 2017 19:27:22 +0200 Subject: prevent it::put tempfiles from being processed --- it.class | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/it.class b/it.class index 30dbf92..a96032f 100644 --- a/it.class +++ b/it.class @@ -1037,8 +1037,9 @@ static function file_put($filename, $data, $p = array()) if ($p['mkdir'] && $filename != "-") @mkdir(dirname($filename)); - if (($result = file_put_contents($filename == "-" ? "php://stdout" : "$filename.tmp." . getmypid(), $data)) !== false && $filename != "-") - $result = rename("$filename.tmp." . getmypid(), $filename); + $tmpfile = dirname($filename) . "/.it_put." . basename($filename) . "." . getmypid(); + if (($result = file_put_contents($filename == "-" ? "php://stdout" : $tmpfile, $data)) !== false && $filename != "-") + $result = rename($tmpfile, $filename); return $result; } -- cgit v1.2.3