pluf2

pluf2 Commit Details


Date:2008-11-27 04:12:57 (16 years 25 days ago)
Author:Loic d'Anterroches
Branch:master
Commit:4a4fe11a64c80380998fb8f81ac9ab6117cb211c
Parents: 9eed1bd5e4314d77ccef3834c1c3f34ff4e89fce
Message:Improved the upload of files in case of no files.

Changes:

File differences

src/Pluf/Form/Field/File.php
3737
3838
3939
40
41
42
43
44
4045
4146
4247
function clean($value)
{
parent::clean($value);
if (is_null($value) and !$this->required) {
return ''; // no file
} elseif (is_null($value) and $this->required) {
throw new Pluf_Form_Invalid(__('No files were uploaded. Please try to send the file again.'));
}
$errors = array();
$no_files = false;
switch ($value['error']) {
src/Pluf/Utils.php
7979
8080
8181
82
8382
8483
8584
*/
static function cleanFileName($name)
{
$name = mb_strtolower($name, 'UTF-8');
return mb_ereg_replace("/\015\012|\015|\012|\s|[^A-Za-z0-9\.\-\_]/", '_', $name);
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06778s using 13 queries.