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. However, smarty must run in a way similar to temp. when the PHP function: tempnam () is disabled in PHP, tempnam () can create a temporary file. 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. However, to run smarty, you must set the compilation directory in a way similar to templates_c. after running the program, it will create a directory similar to %.
431000043b000043b32f4b00000000index.htm. php temporary file. Therefore, after tempnam () is disabled, you cannot create a temporary file similar to %.
4336643b%43b32f4b%%%index.htm. php temporary file, naturally took the initiative to create a temporary file similar to % 43%4343b%43b32f4b%%index.htm. php, is a vacancy.
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'