fixing some typos. also the File/Storage bug. also fixing the changelogs.

This commit is contained in:
Matthew Wilson 2006-01-03 05:12:51 +00:00
parent 21188e7949
commit e4bf3c60b0
6 changed files with 24 additions and 27 deletions

View file

@ -203,14 +203,9 @@ sub addFileFromFormPost {
my $attachmentCount = 1;
foreach my $upload ($session{req}->upload($formVariableName)) {
return $filename if $attachmentCount > $attachmentLimit;
my $tempPath = $upload->tempname();
$filename = $upload->filename();
next unless $filename;
if ($tempPath =~ /([^\/\\]+)$/) {
$filename = $1;
} else {
$filename = $tempPath;
}
if ($filename =~ /([^\/\\]+)$/) { $filename = $1; }
my $type = $self->getFileExtension($filename);
if (isIn($type, qw(pl perl sh cgi php asp))) { # make us safe from malicious uploads
$filename =~ s/\./\_/g;
@ -233,7 +228,8 @@ sub addFileFromFormPost {
return undef;
}
}
return $filename;
return $filename if $filename;
return undef;
}