From 71f10579c00a8ddc20ada1a1efd33aac25a3da7e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Jul 2008 10:42:58 -0400 Subject: attachment: Support old versions of CGI.pm that lack an upload method. --- IkiWiki/Plugin/attachment.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 90e0f0f0b..f4f64b46a 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -133,7 +133,11 @@ sub formbuilder (@) { #{{{ else { my $fh=$q->upload('attachment'); if (! defined $fh || ! ref $fh) { - error("failed to get filehandle"); + # needed by old CGI versions + $fh=$q->param('attachment'); + if (! defined $fh || ! ref $fh) { + error("failed to get filehandle"); + } } binmode($fh); writefile($filename, $config{srcdir}, undef, 1, sub { -- cgit v1.2.3