Ensure the zero-sized file created by the "tmpnam" function is deleted

This commit is contained in:
Loïc Chapeaux
2001-11-25 14:36:40 +00:00
parent d09b82e84a
commit cd6bcf610b

View File

@@ -142,7 +142,9 @@ if (!function_exists('is_uploaded_file')) {
*/
function is_uploaded_file($filename) {
if (!$tmp_file = @get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
$tmp_file = tempnam('','');
$deleted = @unlink($tmp_file);
$tmp_file = dirname($tmp_file);
}
$tmp_file .= '/' . basename($filename);