Indefero

Indefero Commit Details

Date:2008-08-05 21:01:06 (5 years 11 months ago)
Author:Loïc d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3, svn
Commit:78cf0c1c856a78238694e95569eb4e91f920d235
Parents: 9f67343e36dcc08a351085259d2d867716e1a3d1
Message:Fixed to push the overwrite check at the framework level.

Changes:
Msrc/IDF/Form/Upload.php (2 diffs)

File differences

src/IDF/Form/Upload.php
4949
5050
5151
52
52
53
5354
5455
5556
......
7071
7172
7273
73
74
75
7674
7775
7876
'label' => __('File'),
'initial' => '',
'move_function_params' => array('upload_path' => Pluf::f('upload_path').'/'.$this->project->shortname.'/files',
'upload_path_create' => true),
'upload_path_create' => true,
'upload_overwrite' => false),
));
for ($i=1;$i<7;$i++) {
if (!preg_match('/\.(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'])) {
throw new Pluf_Form_Invalid(__('For security reason, you cannot upload a file with this extension.'));
}
if (file_exists(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file'])) {
throw new Pluf_Form_Invalid(sprintf(__('A file with the name "%s" is already available for download.'), $this->cleaned_data['file']));
}
return $this->cleaned_data['file'];
}

Archive Download the corresponding diff file