diff options
author | Urban Müller | 2017-03-29 19:27:22 +0200 |
---|---|---|
committer | Urban Müller | 2017-03-29 19:27:22 +0200 |
commit | a4f1a3241fda15df244cf77613e1405a8d50810b (patch) | |
tree | d261a2b6a25da2a945342d9e7e6ca07590aec4b0 | |
parent | f366953bd8aabeb7f4be7d33dc8d358a4839d8ba (diff) | |
download | itools-a4f1a3241fda15df244cf77613e1405a8d50810b.tar.gz itools-a4f1a3241fda15df244cf77613e1405a8d50810b.tar.bz2 itools-a4f1a3241fda15df244cf77613e1405a8d50810b.zip |
prevent it::put tempfiles from being processed
-rw-r--r-- | it.class | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |