After the PHP function tempnam () is disabled, tempnam () can create a temporary file, and the file name will not be overwritten with the file in the same directory.
The returned string is the temporary file name. If an error occurs, an empty string is returned.
431000043b000043b32f4b00000000index.htm. php temporary file. Therefore, after tempnam () is disabled, you cannot automatically create a file similar to %
43000043b000043b32f4b00000000index.htm. php temporary file, automatically create a file similar to %
In smarty, the program that uses the tempnam function is internals/core. write_file.php, and the code is as follows:
PHP code:
// write to tmp file, then rename it to avoid
// file locking race condition
$_tmp_file = tempnam($_dirname, wrt);
if (!($fd = @fopen($_tmp_file, wb))) {
$_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid(wrt);
if (!($fd = @fopen($_tmp_file, wb))) {
$smarty->trigger_error("problem writing temporary file $_tmp_file");
return false;
}
}
fwrite($fd, $params[contents]);
fclose($fd);