attempting to fix 463213

This commit is contained in:
Matthew Wilson 2005-12-19 15:22:09 +00:00
parent d085152304
commit 08954dbe3c

View file

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