From 08954dbe3c3af76f70a52b8209edabed99400bf9 Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Mon, 19 Dec 2005 15:22:09 +0000 Subject: [PATCH] attempting to fix 463213 --- lib/WebGUI/Storage.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 6a2cdee0a..240165ba9 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -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;