check for tempfile being empty
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 20:21:01 +0000 (16:21 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 20:21:01 +0000 (16:21 -0400)
IkiWiki/Plugin/attachment.pm

index 53d826178891a901bb1750949d2abaf638bcc693..f49fe63f770aef606ad8208bac4377a9e8c360e4 100644 (file)
@@ -88,8 +88,8 @@ sub formbuilder (@) { #{{{
                # of the temp file that CGI writes the upload to.
                my $tempfile=$q->tmpFileName($filename);
                
-               if (! defined $tempfile) {
-                       error("failed to determine temp filename");
+               if (! defined $tempfile || ! length $tempfile) {
+                       error("failed to determine tempfile name");
                }
 
                $filename=IkiWiki::titlepage(