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, to run smarty, you must set the compilation directory in a format similar to templates_c. After the program is run, it will automatically create a directory similar to %.
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 %
431000043b000043b32f4b00000000index.htm. php temporary file, is blank.
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 );