summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class6
1 files changed, 4 insertions, 2 deletions
diff --git a/it.class b/it.class
index 714ffc4..768ee02 100644
--- a/it.class
+++ b/it.class
@@ -1108,9 +1108,11 @@ static function file_put($filename, $data, $p = array())
if ($p['mkdir'] && $filename != "-")
@mkdir(dirname($filename));
- $tmpfile = dirname($filename) . "/.it_put." . basename($filename) . "." . getmypid();
+ $tmp = $GLOBALS['ULTRAHOME'] . "/tmp";
+ $tmpdir = is_dir($tmp) && stat($tmp)[0] == stat(dirname($filename))[0] ? $tmp : dirname($filename);
+ $tmpfile = "$tmpdir/.it_put." . basename($filename) . "." . getmypid();
if (($result = it::file_put_contents($filename == "-" ? "php://stdout" : $tmpfile, $data)) !== false && $filename != "-")
- $result = rename($tmpfile, $filename);
+ $result = rename($tmpfile, $filename);
return $result;
}