PHP-YUI-Compressor icon indicating copy to clipboard operation
PHP-YUI-Compressor copied to clipboard

Use tempnam() for temporary filenames to avoid collisions completely

Open WanderingZombie opened this issue 12 years ago • 1 comments

Just a suggestion... change the following to use PHP's tempnam() function to avoid all chance of collision

    $input_hash = sha1($this->string);
    $file = $this->TEMP_FILES_DIR . '/' . $input_hash . '.txt';

WanderingZombie avatar May 02 '13 15:05 WanderingZombie

implemented in https://github.com/bkdotcom/PHP-YUI-Compressor

additionally, uses sys_get_temp_dir() as a default temp_dir

bkdotcom avatar Jul 25 '13 18:07 bkdotcom