Fix bug 10916: files prefixed with thumb- cause errors.

Rename files that are uploaded to remove thumb-.
This commit is contained in:
Colin Kuskie 2009-10-06 10:08:43 -07:00
parent 6c4b4d1a88
commit 0e94d42034
4 changed files with 35 additions and 25 deletions

View file

@ -381,6 +381,7 @@ sub addFileFromFormPost {
next
if ($upload->size > 1024 * $self->session->setting->get("maxAttachmentSize"));
$clientFilename =~ s/.*[\/\\]//;
$clientFilename =~ s/^thumb-//;
my $type = $self->getFileExtension($clientFilename);
if (isIn($type, qw(pl perl sh cgi php asp html htm))) { # make us safe from malicious uploads
$clientFilename =~ s/\./\_/g;