After the PHP function is disabled: tempnam ()

Source: Internet
Author: User
Tags tmp file
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'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.