From ca5270a07444e6ec137acfd1a45bf13c4a3a06b7 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Mon, 3 Aug 2009 21:38:32 +0200 Subject: [PATCH] Fixed issue 275, unable to activate a file already uploaded if first upload was in error. --- src/IDF/Form/Upload.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/IDF/Form/Upload.php b/src/IDF/Form/Upload.php index 91daa03..bdd2339 100644 --- a/src/IDF/Form/Upload.php +++ b/src/IDF/Form/Upload.php @@ -82,6 +82,7 @@ class IDF_Form_Upload extends Pluf_Form $extra = strtolower(implode('|', explode(' ', Pluf::f('idf_extra_upload_ext')))); if (strlen($extra)) $extra .= '|'; if (!preg_match('/\.('.$extra.'png|jpg|jpeg|gif|bmp|psd|tif|aiff|asf|avi|bz2|css|doc|eps|gz|mdtext|mid|mov|mp3|mpg|ogg|pdf|ppt|ps|qt|ra|ram|rm|rtf|sdd|sdw|sit|sxi|sxw|swf|tgz|txt|wav|xls|xml|wmv|zip)$/i', $this->cleaned_data['file'])) { + @unlink(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file']); throw new Pluf_Form_Invalid(__('For security reason, you cannot upload a file with this extension.')); } return $this->cleaned_data['file'];