attempting to fix 463213
This commit is contained in:
parent
d085152304
commit
08954dbe3c
1 changed files with 7 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue