- Fixed a syntax error in Post.pm

- fix [ 1382675 ] File Path Wrong - Uploads are difficult
 - fix [ 1380368 ] Snippets should not contain debugging info
 - fix [ 1377668 ] Unescaped double quote in Syndacate title cause problems
This commit is contained in:
JT Smith 2005-12-16 19:52:07 +00:00
parent a1e85d8b12
commit 1bcfa3bddc
6 changed files with 24 additions and 17 deletions

View file

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