forward port of 0 file size upgrade fix

This commit is contained in:
Colin Kuskie 2006-02-09 17:38:02 +00:00
parent 806e47e51c
commit 54f0338696
3 changed files with 3 additions and 1 deletions

View file

@ -201,6 +201,7 @@ sub addFileFromFormPost {
return $filename if $attachmentCount > $attachmentLimit;
my $tempFilename = $upload->filename();
next unless $tempFilename;
next unless $upload->size > 0;
if ($tempFilename =~ /([^\/\\]+)$/) { $tempFilename = $1; }
my $type = $self->getFileExtension($tempFilename);
if (isIn($type, qw(pl perl sh cgi php asp))) { # make us safe from malicious uploads