diff options
-rw-r--r-- | it.class | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |